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

Feature request: clean from outside of the project root as well. #45

Closed
rbatllet opened this issue Apr 4, 2017 · 3 comments
Closed

Comments

@rbatllet
Copy link

rbatllet commented Apr 4, 2017

My target build is outside the project root and the previous build can not be cleaned (it's skipped). Please add an option to force to clean the target folder.

@chrisblossom
Copy link
Collaborator

Please provide more information on how you are trying to clean outside the "target folder"?

See:
tests.js#L61-L67
#17
#18

@rbatllet
Copy link
Author

rbatllet commented Apr 6, 2017

Here it is:

const targetPath = '../test-webapp/src/main/resources/public/frontend';

module.exports = function() {
  return webpackMerge(commonConfig, {
    ...
    plugins: [
      new CleanWebpackPlugin(['dist', targetPath], {
        root: process.cwd()
      })
    ],
  });
};

@rbatllet
Copy link
Author

rbatllet commented Apr 6, 2017

It does work:

const basePath = __dirname;
const targetPath = '../test-webapp/src/main/resources/public/frontend';
const targetFolder = 'dist';

module.exports = function() {
  return webpackMerge(commonConfig, {
    ...
    plugins: [
      new CleanWebpackPlugin([targetFolder], {
        root: basePath + '/' + targetPath
      })
    ],
  });
};

Thank you!

@rbatllet rbatllet closed this as completed Apr 6, 2017
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