Answers for "clean-webpack-plugin webpack-dev-server issue"

0

clean-webpack-plugin webpack-dev-server issue

webpack dev server causing the recompile and thus invocation 
of clean webpack plugin, which clears dist folder. but to keep files
there in dist folder you must instruct it to write to disk.

then after every recompile it writes files to disk this can be set
through writeToDisk:true,

devServer: {
index: 'index.html',
contentBase: path.join(__dirname, 'dist'),
compress: true,
hot: true, //Hot module replacement
port: 9000,
writeToDisk:true,
open: 'chrome' //open in chrome
}
Posted by: Guest on December-15-2020

Code answers related to "clean-webpack-plugin webpack-dev-server issue"

Code answers related to "Javascript"

Browse Popular Code Answers by Language