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

Problems when using the plugin in Windows #62

Closed
splincode opened this issue Jul 20, 2017 · 3 comments
Closed

Problems when using the plugin in Windows #62

splincode opened this issue Jul 20, 2017 · 3 comments

Comments

@splincode
Copy link

splincode commented Jul 20, 2017

When I run my builder in TeamCity CI, I get an argument, which directory should be deleted.

  • Windows
    C:\Users\splincode\Git\blackbox/core-adapter-web/target/classes/webapp

  • Linux
    /home/splincode/Git/blackbox/core-adapter-web/target/classes/webapp

So, the path arrives absolute and I can not know exactly where the script can run from. If I use current configuration, it's work in Linux:

var CleanWebpackPlugin = require('clean-webpack-plugin');
var dist = process.env["remove-temporary-folder"];

module.exports = {
  plugins: [
    new CleanWebpackPlugin([dist], {
      root: '/',
      verbose: true
    })
  ]
}

But, does not work in Windows, because I need set root as value "C:/". What should I do to make it cross-platform and work?

@IllusionMH
Copy link

@splincode You can use path.resolve('/') to get root folder (be aware that if you are running node on drive D: it will return 'D:\\' instead of 'C:\\').
If this temp folder is inside your working directory - you can just use paths relative to config file (which is usually in the root of the project) and may omit root property in options (defaults to __dirname)

@johnagan
Copy link
Owner

Did @splincode did @IllusionMH's answer solve your issue?

@splincode
Copy link
Author

Yes, thank's

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

3 participants