提交 9c3dc4ba 编写于 作者: A afc163

update webpack dev config

上级 93ad7f49
...@@ -31,26 +31,28 @@ exports.writers = [ ...@@ -31,26 +31,28 @@ exports.writers = [
exports.middlewares = [{ exports.middlewares = [{
name: 'webpack', name: 'webpack',
filter: /index\.js/, filter: /index\.js/,
handle: webpackMiddleware(webpack(require('./webpack.config')), { handle: function(req, res, next) {
// all options optional return webpackMiddleware(webpack(require('./webpack.config')), {
// all options optional
noInfo: false, noInfo: false,
// display no info to console (only warnings and errors) // display no info to console (only warnings and errors)
watchDelay: 300, watchDelay: 300,
// delay after change (only lazy: false) // delay after change (only lazy: false)
publicPath: "/dist/", publicPath: "/dist/",
// public path to bind the middleware to // public path to bind the middleware to
// use the same as in webpack // use the same as in webpack
headers: { "X-Custom-Header": "yes" }, headers: { "X-Custom-Header": "yes" },
// custom headers // custom headers
stats: { stats: {
colors: true colors: true
} }
// options for formating the statistics // options for formating the statistics
}) })(req, res, next);
}
}]; }];
// end settings }} // end settings }}
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"webpack-dev-middleware": "~1.0.11" "webpack-dev-middleware": "~1.0.11"
}, },
"scripts": { "scripts": {
"build": "npm run clean && nico build", "build": "npm run clean && webpack && nico build",
"start": "npm run clean && nico server --watch", "start": "npm run clean && nico server --watch",
"clean": "rm -rf _site", "clean": "rm -rf _site",
"deploy": "npm run build && gh-pages -d _site -b master" "deploy": "npm run build && gh-pages -d _site -b master"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册