Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clean-webpack-plugin and include as default for production builds. #31

Closed
mattheu opened this issue Aug 21, 2019 · 3 comments
Closed
Milestone

Comments

@mattheu
Copy link
Member

mattheu commented Aug 21, 2019

It would be nice to include clean-webpack-plugin for production builds to ensure the build directory doesn't contain any old files.

Let me know your thoughts - happy to open a PR for this.

@mattheu
Copy link
Member Author

mattheu commented Aug 21, 2019

Such an idiot - didn't see this was bundled.

However - the version bundled is 1.0, but the plugin is now at 3.0. The latest version doesn't require you to pass paths, if you just call new CleanPlugin() then it automatically cleans the webpack output path - zero config required. So currently its less config to just use the plugin directly and skip the webpack-helpers version.

Additionally... any reason not to just clean the webpack output path by default for production builds?

@mattheu mattheu changed the title Include clean-webpack-plugin for production builds. Update clean-webpack-plugin and include as default for production builds. Aug 21, 2019
@kadamwhite
Copy link
Contributor

No strong opinions on cleaning by default, I think if I consider your argument for long enough you'll have me convinced. We should definitely update the dependency, nice catch.

@kadamwhite
Copy link
Contributor

We cannot actually clean by default, because then if somebody does

module.exports = [
  presets.production( { ... } ),
  presets.production( { ... } ),
];

then only one build will get output correctly (whichever runs second will clear the build folder, removing all files from the first-run build). However, this can be added as an option, for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants