clean webpack plugin webpack dev server issue

Solutions on MaxInterview for clean webpack plugin webpack dev server issue by the best coders in the world

showing results for - "clean webpack plugin webpack dev server issue"
Julian
29 Mar 2019
1webpack dev server causing the recompile and thus invocation 
2of clean webpack plugin, which clears dist folder. but to keep files
3there in dist folder you must instruct it to write to disk.
4
5then after every recompile it writes files to disk this can be set
6through writeToDisk:true,
7
8devServer: {
9index: 'index.html',
10contentBase: path.join(__dirname, 'dist'),
11compress: true,
12hot: true, //Hot module replacement
13port: 9000,
14writeToDisk:true,
15open: 'chrome' //open in chrome
16}