make webpack middleware into boot scripts

This commit is contained in:
2017-01-22 14:05:55 -07:00
parent 88b860958b
commit 7eac56f092
7 changed files with 25 additions and 30 deletions

View 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);
};