You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While adapting a CSP optimizer plugin, which currently works as expected when using the parcel live server/parcel command (which returns asset links like src="/index.hash.js"), but returns non-existent filenames once parcel build is used (and thus having assets links like src="/index.HASH_REF_19010c15bfc1db13.js)
# Works
npm run start
# Doesn't work
npm run build
🤔 Expected Behavior
The final src filenames should(I assume?) be shown in the optimizer's html input (e.g. /index.c36f364e.js)
😯 Current Behavior
Once parcel build is used instead of serve, the html contents (logged at this part in the code returns ... src: '/index.HASH_REF_19010c15bfc1db13.js' ..., which doesn't include the final filename. As such I cannot read them to hash them down the road, which is suboptimal
🌍 Your Environment
Software
Version(s)
Parcel
2.12.0
Node
v22.2.0
npm/Yarn
Nix npm doesn't want to show me i guess
Operating System
NixOS 24.05
The text was updated successfully, but these errors were encountered:
Denperidge
changed the title
HASH_REF_PREFIX in optimizer <script src> when building
Parcel build returns temporary filenames to (html) optimiser
Sep 11, 2024
The optimizing phase transforms the contents of each bundle. When this is done, Parcel determines the content hashes of each bundle, which are applied to the final output filenames.
Optimizer isn't the right thing to use. Ended up using a reporter instead! Issue closed.
🐛 bug report
While adapting a CSP optimizer plugin, which currently works as expected when using the parcel live server/
parcel
command (which returns asset links likesrc="/index.hash.js"
), but returns non-existent filenames once parcel build is used (and thus having assets links likesrc="/index.HASH_REF_19010c15bfc1db13.js
)See the repo source at https://github.com/Denperidge/parcel-optimizer-strict-csp
See the example repo at https://github.com/Denperidge-Contrib/parcel-optimizer-strict-csp-example
🎛 Configuration (.babelrc, package.json, cli command)
.parcelrc
🤔 Expected Behavior
The final src filenames should(I assume?) be shown in the optimizer's html input (e.g.
/index.c36f364e.js
)😯 Current Behavior
Once parcel build is used instead of serve, the html contents (logged at this part in the code returns
... src: '/index.HASH_REF_19010c15bfc1db13.js' ...
, which doesn't include the final filename. As such I cannot read them to hash them down the road, which is suboptimal🌍 Your Environment
The text was updated successfully, but these errors were encountered: