added webpack-dev-middleware for recompiling on source changes

This commit is contained in:
Danny Coates 2017-08-09 19:22:20 -07:00
parent 314ab237ec
commit 21b7f16b1e
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
4 changed files with 63 additions and 14 deletions

View file

@ -38,6 +38,17 @@ function prodLangs() {
const availableLanguages = conf.l10n_dev ? allLangs() : prodLangs();
if (conf.env === 'development') {
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const config = require('../webpack.config.js');
config.devtool = 'inline-source-map';
const compiler = webpack(config);
app.use(webpackDevMiddleware(compiler, {
publicPath: config.output.publicPath
}));
}
app.engine(
'handlebars',
exphbs({