-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Closed
Copy link
Description
Bug report
What is the current behavior?
I'm trying to modify the source of the module based on this comment
So my code looks like this:
compilation.hooks.buildModule.tap('MyPlugin', (module) => {
module.addDependency(new MyDependency())
})But it's doesn't work because in the build method webpack resets dependencies of module
Line 879 in 2151f56
| this.clearDependenciesAndBlocks(); |
If the current behavior is a bug, please provide the steps to reproduce.
Clone https://github.com/7rulnik/webpack-repro-13361 and run yarn && yarn webpack
What is the expected behavior?
I don't quite follow the logic of clearDependenciesAndBlocks, but I thing that it should contain check for dependencies.length
Other relevant information:
webpack version: 5.36.2
Node.js version: v14.15.4
Operating System: MacOS 11.3 M1
Reactions are currently unavailable