New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack 5 #126
Comments
Webpack 5 is expected to be updated as soon as possible. |
@LP1994 you're awaiting it eagerly :-) The 1.5.0 release with Webpack 5 support isn't far off, just waiting for one more review. In the meantime, feel free to point your |
Okay, I will, I am a person who is passionate about new things and a big fan of webpack! |
Closed by #130, released in 1.5.0. |
Sir, when I load JS using ES6's dynamic import syntax( as: import('../test/Test.esm.js') ), the plug-in does not generate the Sri values correctly. There are a few things that I don't understand: 2、"154990" in "s.integrity = o.sriHashes[ 154990]" should be "788760". 3、Why does "154990" always exist when I use ES6's dynamic syntax to import scripts? |
@LP1994 please could you create a sample repository that shows the problem? |
Okay, but we will be able to create a warehouse for your testing later. |
https://github.com/LP1994/webpack-subresource-integrity-test1.git |
Step 1: npm i The results are in the dist folder. |
@LP1994 thanks for putting together the sample repository. You're using @jantimon is this on your radar? Let me know if there's anything I can do to help from my side. |
hey :) the current alpha is using the new webpack apis to add and delete assets: https://webpack.js.org/api/compilation-object/#emitasset Maybe all you have to do is to switch to getAssets or getAsset. Please let me know if I can be of any help to solve this issue |
@jantimon ah, right, interesting... there's a little bit more to it, but yes it looks like it's mostly a bit of rejiggling. There's one issue though, it appears that |
I am not sure if this is possible - Webpack 5 disallows adding assets after the So we have a timing conflict:
|
Perhaps the HTML files your plugin generates shouldn't be considered "assets" in the Webpack sense after all? What's the reason behind switching to |
The reason is a change in the webpack architecture:
The other reason is that plugins like the compression plugin or workbox generate their assets based on the html-webpack-plugin and expect it to be created as part of the webpack asset generation. So given that you have now Workbox + Compression + Html + SubresourceIntegrity there would be only one possible timeline:
A user of those plugins would really need to understand the webpack asset processing and add the plugins in the perfect order. Otherwise they would not able to work correctly. Hopefully the webpack core team can help us out here :) |
@jantimon is it maybe just a matter of selecting the right |
|
However, 1.5.0 is still OK, but the Sri of dynamically imported files cannot be generated correctly. Now, however, none of the Sri values work. |
@LP1994 please don't comment across multiple tickets about the same issue. I've tested your example with webpack-subresource-integrity 1.5.1, webpack 5.1.3, and html-webpack-plugin 4.5.0 and it works fine here now. html-webpack-plugin 5.0.0-alpha is currently unsupported. You need to use version 4. If you can confirm it works with version 4, please let me know. If you still have problems:
Thank you. |
OK. |
optimization.realContentHash
webpack-sources
dependency in favor ofrequire("webpack").sources
The text was updated successfully, but these errors were encountered: