shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 185 forks source link

Best way to output SRI #129

Closed rheaditi closed 6 years ago

rheaditi commented 6 years ago

Hi! Thanks for this plugin :)

Just wondering if there's a recommended way to generate the SRI hashes and also output them - or if this should be handled elsewhere outside the scope of this plugin.

mastilver commented 6 years ago

Hi please check: https://github.com/danethurber/webpack-manifest-plugin/issues/35#issuecomment-313637413

We should add this example in examples/subresource-integrity/, if you feel like it, feel free to send a PR

RinkAttendant6 commented 6 years ago

https://github.com/danethurber/webpack-manifest-plugin/issues/35#issuecomment-313637413 does not work any more. I tried with the new generate method and there is no source property on the file in every iteration of the reduce method.

I also notice that the other plugin states that the integrity property is added to Webpack assets, but all of the files iterated through the reduce method have isAsset: false. Is this normal for multiple entry points?

I'm thinking of hacking together something in the generate function using https://www.npmjs.com/package/ssri if all else fails

mastilver commented 6 years ago

does not work any more.

@RinkAttendant6 What did you change before it broke?

RinkAttendant6 commented 6 years ago

@mastilver I was assuming that it worked at some point in time. I switched my team's project over to Webpack earlier this year, before we were using Browserify and the SRI manifest was generated using grunt-sri (it still is, this is one of the two steps in our build process that is still using Grunt outside of Webpack). This is my first attempt to generate the manifest using Webpack so it is something new for me.