This repository has been archived by the owner on Mar 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Tries to cleanup /
when run under webpack-dev-server
#7
Comments
jonathanperret
changed the title
Tries to cleanup / when run under webpack-dev-server
Tries to cleanup Mar 8, 2016
/
when run under webpack-dev-server
Note that at least one other plugin hit that issue: gajus/write-file-webpack-plugin#1 |
Thanks for reporting. I never tested this plugin with the dev server. 😰 I think the best solution is explicitly requiring the path to delete from the constructor. |
jonathanperret
added a commit
to jonathanperret/webpack-cleanup-plugin
that referenced
this issue
Mar 8, 2016
In particular, `webpack-dev-server` forces an in-memory filesystem and sets the output path to `/`, breaking this plugin. Fixes gpbl#7.
@gpbl Remove this repo and disable the npm package if you aren't going to fix this problem. You should have removed this in March until you addressed the issue. |
Yup @kmcmichael-twist sorry for the unforgivable delay 🙏 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Warning: try this in a VM/container/throwaway machine. There is a risk that files will be removed from all over the disk!
With the example
webpack.config.js
:If you try running webpack-dev-server:
You will end up with, if you're lucky, an error in
recursiveReaddirSync
:If you're unlucky, the scan will complete and
WebpackCleanupPlugin
will happily proceed with removing all the files from your disk.This happens because
webpack-dev-server
forces the output path to/
: https://github.com/webpack/webpack-dev-server/blob/5b94506/bin/webpack-dev-server.js#L142Because
webpack-dev-server
uses an in-memory filesystem, it can get away with a/
output path. Not so forWebpackCleanupPlugin
, unfortunately.The text was updated successfully, but these errors were encountered: