webpack-dev-server is slow.
- Use webpack's watch feature
- Don't put files in memory, write them to disk instead
- Use serve to serve the compiled static files
That's all.
npm i webpack-simple-serve -D
In the directory where your webpack.config.js is, run:
node_modules/.bin/webpack-simple-serve
"scripts": {
"dev": "webpack-simple-serve"
}
To get help for all options:
node_modules/.bin/webpack-simple-serve -h
const path = require('path');
module.exports = {
//...
simpleDevServer: {
contentBase: path.resolve(__dirname, 'dist'),
port: 3000
}
};