From 9c3dc4ba3cc6392dfe5038a884fb9c28963774d4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 25 May 2015 21:04:53 +0800 Subject: [PATCH] update webpack dev config --- nico.js | 34 ++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/nico.js b/nico.js index b51c1be9c7..53a1fd8f48 100644 --- a/nico.js +++ b/nico.js @@ -31,26 +31,28 @@ exports.writers = [ exports.middlewares = [{ name: 'webpack', filter: /index\.js/, - handle: webpackMiddleware(webpack(require('./webpack.config')), { - // all options optional + handle: function(req, res, next) { + return webpackMiddleware(webpack(require('./webpack.config')), { + // all options optional - noInfo: false, - // display no info to console (only warnings and errors) + noInfo: false, + // display no info to console (only warnings and errors) - watchDelay: 300, - // delay after change (only lazy: false) + watchDelay: 300, + // delay after change (only lazy: false) - publicPath: "/dist/", - // public path to bind the middleware to - // use the same as in webpack + publicPath: "/dist/", + // public path to bind the middleware to + // use the same as in webpack - headers: { "X-Custom-Header": "yes" }, - // custom headers + headers: { "X-Custom-Header": "yes" }, + // custom headers - stats: { - colors: true - } - // options for formating the statistics - }) + stats: { + colors: true + } + // options for formating the statistics + })(req, res, next); + } }]; // end settings }} diff --git a/package.json b/package.json index 688abede0a..8d0f877702 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "webpack-dev-middleware": "~1.0.11" }, "scripts": { - "build": "npm run clean && nico build", + "build": "npm run clean && webpack && nico build", "start": "npm run clean && nico server --watch", "clean": "rm -rf _site", "deploy": "npm run build && gh-pages -d _site -b master"