refactor:refine webpack.prod.conf.js

This commit is contained in:
Pan 2017-11-09 18:17:08 +08:00
parent 61deec548c
commit 61095a9f2c
2 changed files with 4 additions and 6 deletions

View File

@ -1,10 +1,7 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
"modules": false
}],
"stage-2"
],

View File

@ -27,11 +27,10 @@ var webpackConfig = merge(baseWebpackConfig, {
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[name].[chunkhash].js'),
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,
@ -77,6 +76,8 @@ var webpackConfig = merge(baseWebpackConfig, {
}),
// cache Module Identifiers
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',