clean-webpack-plugin: clean-webpack-plugin: options.output.path not defined. Plugin disabled...
Issue description or question
With webpack 5.11.1 and clean-webpack-plugin 3.0.0 I get error clean-webpack-plugin: options.output.path not defined. Plugin disabled...
when path
isn’t defined explicitly in the config file. But https://webpack.js.org/configuration/output/#outputpath defines a default path so is this check necessary? It should use the default path if one isn’t provided explicitly.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 29
- Comments: 15
Commits related to this issue
- :rotating_light: Explicitly add output.path - see https://github.com/johnagan/clean-webpack-plugin/issues/194 — committed to ampproject/amp.dev by lluerich 3 years ago
- Fix gulp develop warnings (#5829) * :lipstick: Add missing breakpoint * :rotating_light: Explicitly add output.path - see https://github.com/johnagan/clean-webpack-plugin/issues/194 — committed to ampproject/amp.dev by lluerich 3 years ago
- Fix gulp develop warnings (#5829) * :lipstick: Add missing breakpoint * :rotating_light: Explicitly add output.path - see https://github.com/johnagan/clean-webpack-plugin/issues/194 — committed to Enriqe/amp.dev by lluerich 3 years ago
It is worth mentioning that beginning Webpack 5.20.0+, there is an
output.clean
option that cleans the output directory before emit:So, finally, with the
output.clean
option, there is no need to use clean-webpack-plugin, right?@PJ-CM - if you’re on Webpack 5.20.0+, yes, at least for basic clean-up needs, in my opinion.
I get the same error as @rightaway … What is the solution to apply, please?
No, it’s not about correct configuration. It’s about clean-webpack-plugin not taking into account default output.path value when it’s not explicitly provided.
Finally, that’s how it’s working fine: