I read the source code and found "this.outputPath" is assigned only once in "apply" method(besides the intialization in constuctor).
I think it would not cause any problem in mose cases.But when I feed webpack with a array structured config it broke, as "output.path" in each subconfig is not the same and "compiler.options.output.path" would change in this case.
Although maybe my webpack config is not a appropriate one, if "compiler.options.output.path" changed(via other plugins,array structured config with different output path,etc.)in bundling, the plugin will not work as expected(remove files under output.path).
To solve this problem, just add this line in handleInitial
I read the comment "Only happens once" .That means the plugin is designed to apply only once and the issue for output path changed in bundling should not happen.
Issue description or question
I read the source code and found "this.outputPath" is assigned only once in "apply" method(besides the intialization in constuctor).
I think it would not cause any problem in mose cases.But when I feed webpack with a array structured config it broke, as "output.path" in each subconfig is not the same and "compiler.options.output.path" would change in this case.
Although maybe my webpack config is not a appropriate one, if "compiler.options.output.path" changed(via other plugins,array structured config with different output path,etc.)in bundling, the plugin will not work as expected(remove files under output.path).
To solve this problem, just add this line in
handleInitial
Webpack Config
Environment