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
|
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
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:
But it's doesn't work because in the build method webpack resets dependencies of module
webpack/lib/NormalModule.js
Line 879 in 2151f56
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 webpackWhat is the expected behavior?
I don't quite follow the logic of
clearDependenciesAndBlocks, but I thing that it should contain check fordependencies.lengthOther relevant information:
webpack version: 5.36.2
Node.js version: v14.15.4
Operating System: MacOS 11.3 M1