Scripts: Clean up the build folder via clean-webpack-plugin #23134
Labels
[Status] In Progress
Tracking issues with work in progress
[Tool] WP Scripts
/packages/scripts
[Type] Build Tooling
Issues or PRs related to build tooling
Is your feature request related to a problem? Please describe.
Currently, when using a webpack config with multiple entry points and removing one, the old build files for the removed entry point remain in the build folder.
Another case is source maps which are created during the watch task but not used in the production builds.
Describe the solution you'd like
The webpack documentation recommends to use the popular clean-webpack-plugin plugin. We'd have to add it as a new dependency and adjust the plugins config to include
new CleanWebpackPlugin()
.Describe alternatives you've considered
Adding a
prebuild
npm script which cleans up the folder.The text was updated successfully, but these errors were encountered: