提交 8048eb7b 编写于 作者: A afc163

improve debug speed and reliability, using webpack-dev-middleware

上级 48700296
var path = require('path');
var package = require('./package');
var webpack = require('webpack');
var webpackMiddleware = require('webpack-dev-middleware');
var webpackConfig = require('./webpack.config');
var webpackCompiler = webpack(webpackConfig);
// {{ settings for nico
exports.site = {
......@@ -25,6 +29,15 @@ exports.ignorefilter = function(filepath, subdir) {
}
return true;
};
exports.middlewares = [{
name: 'webpackDevMiddleware',
filter: /antd\.(js|css)$/,
handle: webpackMiddleware(webpackCompiler, {
publicPath: '/dist/',
lazy: false,
watchDelay: 200
})
}];
exports.writers = [
'nico-jsx.PageWriter',
'nico-jsx.StaticWriter',
......
......@@ -40,11 +40,12 @@
"nico-jsx": "~0.5.8",
"precommit-hook": "~1.0.7",
"style-loader": "~0.12.2",
"webpack": "~1.9.7"
"webpack": "~1.9.7",
"webpack-dev-middleware": "~1.0.11"
},
"scripts": {
"build": "npm run clean && webpack && nico build",
"start": "npm run clean && concurrent 'webpack -w' 'nico server --watch'",
"start": "npm run clean && nico server --watch",
"clean": "rm -rf _site",
"deploy": "npm run build && gh-pages -d _site -b gh-pages",
"lint": "eslint components index.js --ext '.js,.jsx'",
......
......@@ -44,7 +44,5 @@ module.exports = {
plugins: [
new ExtractTextPlugin('[name].css')
],
devtool: '#source-map'
]
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册