Open robsonsobral opened 5 years ago
It currently does not
Sent with GitHawk
Thank you, @DeMoorJasper . 😞
Hey @DeMoorJasper, I would like to work on this issue, if you don't mind I would like you to guide me a little bit!
@Taym95 awesome, the html transforms are being done inside assets/HTMLAsset
https://github.com/parcel-bundler/parcel/blob/master/src/assets/HTMLAsset.js
You might wanna look at how the name replacing got implemented, as this would need the hash of the final bundles. (and HTMLAsset only has access to asset hashes of the JS files) Not even sure this is possible, didn't realise it when I originally flagged this as good first issue
Oops!
Not even sure this is possible
HTMLPackager would have to run after all childBundles are completely packaged. That isn't the case. First attempt here: https://github.com/parcel-bundler/parcel/tree/subres-integrity
Mhm, I got the feeling SRI only makes sense when using CORS or external dependencies (like CDNs). What would be the benefits in checksuming the files in the same domain?
I've written a package to handle SRI for parcel: https://www.npmjs.com/package/parcel-plugin-subresource-integrity
Give it a try and feel free to ping me with an issue if you get stuck.
cool. it would really be nice if Parcel did it natively.
Would it be possible to enable this in v2? I was trying with posthtml-sri, but that did not work. You already are calculating hashes by default, it should be as simple as tacking it onto a integrity
attribute.
I solved this by running it as a separate process after the parcel build:
e.g:
npm install posthtml-cli posthtml-sri
npx posthtml -u posthtml-sri --posthtml-sri.basePath=build/ build/index.html
I've written a package to handle SRI for parcel: https://www.npmjs.com/package/parcel-plugin-subresource-integrity
Give it a try and feel free to ping me with an issue if you get stuck.
@jonathannen, does this package still work with v2?
Feature Request
Hi! Does Parcel support Subresource Integrity?
🔦 Context
I'm still testing and reading about Parcel (yes, I started last weekend) and couldn't find anything about it.
💻 Code Sample
🌍 Your Environment