refactor:update package.json

This commit is contained in:
Pan
2017-10-31 15:55:59 +08:00
parent d56831679e
commit 3666148ddc
4 changed files with 58 additions and 49 deletions

View File

@@ -34,12 +34,14 @@ var hotMiddleware = require('webpack-hot-middleware')(compiler, {
});
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({action: 'reload'});
cb()
})
});
// currently disabled until this is resolved:
// https://github.com/jantimon/html-webpack-plugin/issues/680
// compiler.plugin('compilation', function (compilation) {
// compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
// hotMiddleware.publish({ action: 'reload' })
// cb()
// })
// })
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {

View File

@@ -30,6 +30,7 @@ var webpackConfig = merge(baseWebpackConfig, {
publicPath: config.build.assetsPublicPath
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
@@ -38,7 +39,8 @@ var webpackConfig = merge(baseWebpackConfig, {
compress: {
warnings: false
},
sourceMap: true
sourceMap: true,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({