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

Consider using CleanPlugin #39

Closed
alexilyaev opened this issue Oct 22, 2015 · 1 comment
Closed

Consider using CleanPlugin #39

alexilyaev opened this issue Oct 22, 2015 · 1 comment

Comments

@alexilyaev
Copy link
Contributor

Right now Kick removes the dist folder before each run of kick bundle.

I think we should move the responsibility of this task to Webpack.
We should try to minimize the amount of dependency on Kick if it's simple to implement.

Ideally, I could use kick as a boilerplate generator only if I wanted to (that's the most simple entry point for most devs).

var CleanPlugin = require('clean-webpack-plugin');

...

if (appEnv === 'production') {
  config.plugins.push(
    // Remove build related folders
    new CleanPlugin(['dist'])
  );
}

Ref:
https://github.com/johnagan/clean-webpack-plugin

@alexilyaev
Copy link
Contributor Author

For some reason CleanPlugin didn't work for me on Windows.
So I used fs-extra:

var fse  = require('fs-extra');

if (appEnv === 'production') {
  // Remove build related folders
  fse.removeSync(distPath);
}

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

No branches or pull requests

1 participant