setup webpack
This commit is contained in:
13
server/boot/webpack-hmr.js
Normal file
13
server/boot/webpack-hmr.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const webpack = require('webpack');
|
||||
const webpackHotMiddleware = require('webpack-hot-middleware');
|
||||
const config = require('../config/webpack.dev');
|
||||
|
||||
const isProduction = (process.env.NODE_ENV === 'production');
|
||||
|
||||
module.exports = (app) => {
|
||||
if (isProduction) return;
|
||||
|
||||
const compiler = webpack(config);
|
||||
|
||||
app.use(webpackHotMiddleware(compiler));
|
||||
};
|
||||
Reference in New Issue
Block a user