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
js file is not injected, but css file is injected to the template with 4.0.0-beta.11 version. #1355
Comments
The filtering is happening here: Line 180 in dfb98e7
can you please add the following code just bellow that line to see what is happening? console.log({entryNames, chunks: self.options.chunks, filteredEntryNames}); |
{ entryNames: |
But that seems to be the correct output right? Especially this part: chunks: [ 'common/common', 'private_show' ],
filteredEntryNames: [ 'common/common', 'private_show' ] In the next step it will turn Lines 188 to 189 in dfb98e7
Which is asking webpack for the related assets: Line 601 in dfb98e7
Maybe you can also add a |
'entryPointFiles':[ 'css/private_show.css', 'js/private_show.js?4c019fd5' ] |
Okay so here it looks wrong - it should add the js file. Even question marks should be supported: Line 598 in dfb98e7
Can you please also add a console.log here? Line 614 in dfb98e7
|
{ extensionRegexp: /.(css|js|mjs)(?|$)/, |
Does that mean the loop is executed only once? 🤔 |
I console in the loop and i got null the two null means these two js file not match? |
i find it, because of add hash after js filename /.(css|js|mjs)(?|$)/.exec('css/private_show.css') |
Sorry I can't follow - why would |
/js/private_show.js%3F3252aa |
sorry for late reply, the "?" is from "output:[name].js?[hash]" , i remove the "?[hash]" , and then it's ok, thank you so much |
This comment has been minimized.
This comment has been minimized.
It looks like the reason is this change by @zbigg who tried to allow We could switch to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent @zbigg Why can you remember why we needed to escape |
@jantimon Well, my reasoning was that webpack works on "files", while TLDR That is not neccessarily true. Now, looking at webpack documentation and this issue i see great impedance mismatch in meaning of "filename" So, looks like something that was expected to be filename was accidentally retrofitted to be "URL or filename"
I would argue that it's not very correct, where you call something "filename" and then attempt to parse it as URL. Nonetheless, giving that loads of people are relying on this behaviour, it's probably better to revert #1257 and document that "filename" is actually something between filename and URL and should be treated with care. |
This comment has been minimized.
This comment has been minimized.
@zbigg I am totally with you people are misusing the This has never been a supported or unit tested feature but a hack that worked because luckily webpack removes the querystring correctly before writing to disk. But unfortunately people used this hack a lot and therefore we should probably allow to reuse it also for the new major release. on the other hand your pull request allowed to use the following questionable characters for filenames:
so the combination of both features would allow:
which should probably be converted to:
or am I wrong? |
Released as html-webpack-plugin 4.0.4 |
The text was updated successfully, but these errors were encountered: