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