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

Delete files on watch not working in Webpack 2 #50

Closed
jewbetcha opened this issue Apr 26, 2017 · 1 comment
Closed

Delete files on watch not working in Webpack 2 #50

jewbetcha opened this issue Apr 26, 2017 · 1 comment

Comments

@jewbetcha
Copy link

Cleaning of files works perfectly every time I build, or start the watch function, but when watching and editing files I just end up with a ton of files after every re-compile. I'm using option watch: true but it seems to have no effect. Also using webpack 2.

My config:

new CleanWebpackPlugin('./dist/*.*', [{
            root: __dirname,
            watch: true,
            verbose: true
        }])
@jewbetcha
Copy link
Author

jewbetcha commented Apr 26, 2017

Fixed it by changing my paths to clean and options into their own array/object respectively and then passing into the plugin.

i.e.

let cleanPaths = [
    './dist/*.*'
];
let cleanOptions = {
    verbose: true,
    watch: true
}

new CleanWebpackPlugin(cleanPaths, cleanOptions)

/shrug

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

1 participant