-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Strange asset name when used with webpack v5.0.0-rc.3 #1522
Comments
@jantimon please focus on it, other plugins don't work |
Thanks for the report I'll try to find out what causes the issue 👍 Are you already using the html-webpack-plugin hooks to get the correct assets? |
No, in the case of If there are |
This behaviour might also exist in environments that haven't yet upgraded to webpack v5 -- I'm seeing it appear during a build that uses: In the list of filenames that workbox produces for precaching, |
I'm seeing this behavior when used in conjunction with the Webpack compression plugin. The setup worked without issue under Webpack 4. See #1525 |
@jeffposnick here are all events: https://github.com/jantimon/html-webpack-plugin#events I hope that switching to the new asset api will allow us to get rid of |
@jantimon does this mean that https://github.com/webpack-contrib/compression-webpack-plugin needs to make the same adjustments? |
The main issue is this part: html-webpack-plugin/lib/child-compiler.js Lines 185 to 187 in 3768bba
Although we delete the Webpack 5 came up with a new asset api. |
Oh, right, I remember those from the context of another
FWIW, the new Asset API was introduced in |
A minimal repro case for this is available in https://github.com/jayaddison/htmlwebpackplugin-1522-repro |
Can you please see if this is fixed with [email protected] ? |
@jantimon This is working well for me; I now see the correct behaviour -- no unusual asset names in the workbox precache list -- when using: Verified using https://github.com/jayaddison/htmlwebpackplugin-1522-repro/commit/b716aae855a26742b9d6dc37b600f4efbaba12ad NB: This might not be a concern since you list For Webpack 4.44.2, the following build output appears: $ npx webpack
Cannot read property 'tap' of undefined
$ echo $?
1 Looks good for Webpack 5 though. Owe you a 🍺 Probably worth waiting for feedback from Jeff as well; his project likely has more stringent requirements and quality control than mine :) |
Oh sorry 😨 : - I just saw that there is still one thing missing - so you will have to wait for the next alpha And yes support for webpack 4 has been removed. |
Now it's part of [email protected] |
I just ran our Looks good! Thanks for working on this! |
Awesome thank you Jeff for testing it 👍 |
@jantimon will test this for the compression plugin tonight and close that issue as well if its OK now (which seems very likely). Thanks for your hard work ❤️ |
Expected behaviour
html-webpack-plugin
, when used with webpack v5.0.0-rc.3, should emit assets that have proper names, corresponding to the assets' URLs.Current behaviour
As mentioned at webpack/webpack#11425 (comment), I'm seeing assets with names like
__child-HtmlWebpackPlugin_0
when my own webpack plugin inspects the assets created by thehtml-webpack-plugin
child compilation.Environment
html-webpack-plugin
v4.5.0 andwebpack
v5.0.0-rc.3.Relevant Links
The test case that exercises this code is https://github.com/GoogleChrome/workbox/blob/webpack-v5/test/workbox-webpack-plugin/node/v5/generate-sw.js#L450-L497
The text was updated successfully, but these errors were encountered: