-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
After version 5.78.0, module rules don't seem to apply to resource assets added by a plugin #17747
Comments
@ezzatron This sounds VERY much like what we've been experiencing. The problem only showed up for us in watch mode for the recompilations, the first build never reports any issues. It also doesn't break anything for us which is also super weird. I tracked it down to a specific PR and file/line change but I didn't know enough about how that part of the system worked to really know where to start fixing it. If you try removing the mentioned lines with the latest version, report back if it's the same culprit 🤞 |
@thecontstruct Thanks for the tip. I can confirm that commenting out these lines in the latest Webpack release fixes my issue too. |
Sounds like a small bug, we need improve our checks, do you want to send a PR? |
@alexander-akait I could probably get together a PR, but I'm not confident I could fix the issue without introducing a regression for #16466. Any advice on what that section of the code should actually do? If nothing else I could at least submit a PR with a test that highlights the issue. |
Let's do it and will try to optimize our |
Took me a while, but I managed to get a repro together in #18065 🎉 |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
This is still an issue. It needs someone with more knowledge of the Webpack internals to look at #18065, which is an isolated test case reproducing the issue. |
bump |
Bug report
What is the current behavior?
As of version
5.77.0
, my Webpack plugin was working, but after upgrading to Webpack5.78.0
, with the same Webpack config, it suddenly broke, and Webpack builds produce a loader error like:I've looked through the release notes for that version, but I can't see anything that could explain this breakage.
If the current behavior is a bug, please provide the steps to reproduce.
I've created a simple reproduction in the plugin repo:
git clone [email protected]:iconduit/html-webpack-plugin.git
cd html-webpack-plugin
git switch webpack-5-78-repro
npm ci
cd test/integration/simple
npx webpack
You can also reproduce the (working) behavior under
5.77.0
by using thewebpack-5-77-repro
branch:git clone [email protected]:iconduit/html-webpack-plugin.git
cd html-webpack-plugin
git switch webpack-5-77-repro
npm ci
cd test/integration/simple
npx webpack
I've also verified that problem is reproducible under GitHub Actions. See these workflow runs for working and non-working results:
5.78.0
)5.77.0
)My Webpack config is pretty simple:
What I think is happening, is that my plugin is adding a
.xml
and.webmanifest
asset to the build, but despite the above module rules that should match these and mark them asasset/resource
, the rules are ignored for some reason.It's also completely possible that I'm doing something the wrong way in my plugin. Any help would be greatly appreciated 🙏
What is the expected behavior?
The Webpack build should succeed. In particular, it seems like the
rules
section of the Webpack config is being ignored for assets that are emitted by the plugin.Other relevant information:
webpack version:
v5.78.0
Node.js version:
v20.8.0
Operating System: N/A
Additional tools: N/A
The text was updated successfully, but these errors were encountered: