johnagan / clean-webpack-plugin

A webpack plugin to remove your build folder(s) before building
MIT License
1.96k stars 136 forks source link

Removing all the project #163

Open Buom01 opened 4 years ago

Buom01 commented 4 years ago

Hi An sorry, but I will be really synthetic this time. $webpack-dev-server --open --output dist --config webpack.config.js + clean-webpack-plugin = Evanesco

The webpack config worked perfectly before, for a while, except webpack-dev-server complaining about missing js file while accessing in browser. I haven't any more information now since I run testdisk before getting older backups. So I can't be even sure that this issue is related to clean-webpack-plugin or webpack-dev-server

But I think that in both case it should be any security stopping all if the config file is under the directory that is asked to be delete.

Edit: Just seeing https://github.com/johnagan/clean-webpack-plugin/pull/155 Edit: Unable to restore with testdisk, only able to list all root file, but their size are 0.

Additional information: "clean-webpack-plugin": "^3.0.0", (according to atom)

devServer: {
      contentBase: './dist',
      historyApiFallback: true,
      hot: true,
      overlay: true
    },
chrisblossom commented 4 years ago

Could you provide a minimal reproducible example repo?

Buom01 commented 4 years ago

When I got one of my computer with virtualization capable CPU back, yeah I could eventually try to recreate it. Safely. But the question is ironic. I will try to, but that's a question of time.

KeithTt commented 4 years ago

met similar problem...

when I start the devServer by webpack-dev-server --mode development, the dist dir will be cleared.

here is my webpack config:

devServer: {
        contentBase: path.resolve(__dirname, 'dist'),
        host: '0.0.0.0',
        port: 8080,
        open: true,
        hot: true
    },
new CleanWebpackPlugin(),

and my npm script:

"scripts": {
    "build": "webpack --mode development",
    "serve": "webpack-dev-server --mode development"
  },