commit ae240fb4fe4969db82206cf451625c242fcb2935
parent 4d08585c5c8757589fd1998d6ad17e118917a796
Author: Konstantin Tarkus <hello@tarkus.me>
Date: Sat, 26 Dec 2015 12:17:58 +0300
Merge branch 'dpkirchner-master'
Diffstat:
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/tools/bundle.js b/tools/bundle.js
@@ -19,6 +19,7 @@ function bundle() {
if (err) {
return reject(err);
}
+
console.log(stats.toString(webpackConfig[0].stats));
resolve();
});
diff --git a/tools/start.js b/tools/start.js
@@ -33,6 +33,7 @@ async function start() {
} else {
config.entry = ['webpack-hot-middleware/client', config.entry];
}
+
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.plugins.push(new webpack.NoErrorsPlugin());
config.module.loaders
@@ -60,11 +61,14 @@ async function start() {
const bundler = webpack(webpackConfig);
const wpMiddleware = webpackMiddleware(bundler, {
+
// IMPORTANT: webpack middleware can't access config,
// so we should provide publicPath by ourselves
publicPath: webpackConfig[0].output.publicPath,
+
// Pretty colored output
stats: webpackConfig[0].stats,
+
// For other settings see
// https://webpack.github.io/docs/webpack-dev-middleware
});
@@ -81,6 +85,7 @@ async function start() {
target: host,
middleware: [wpMiddleware, ...hotMiddlewares],
},
+
// no need to watch '*.js' here, webpack will take care of it for us,
// including full page reloads if HMR won't work
files: ['build/content/**/*.*'],
diff --git a/tools/webpack.config.js b/tools/webpack.config.js
@@ -130,7 +130,10 @@ const clientConfig = merge({}, config, {
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
+ // jscs:disable requireCamelCaseOrUpperCaseIdentifiers
screw_ie8: true,
+
+ // jscs:enable requireCamelCaseOrUpperCaseIdentifiers
warnings: VERBOSE,
},
}),