From 33108a136cbad011b505a8b1692995ce2a0e7918 Mon Sep 17 00:00:00 2001 From: SidKwok Date: Fri, 20 Oct 2017 14:56:19 +0800 Subject: [PATCH 1/7] replace `id` with `name` in chunk files, Fix #996 --- template/build/webpack.prod.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/build/webpack.prod.conf.js b/template/build/webpack.prod.conf.js index 07e477bd82..47a9830034 100644 --- a/template/build/webpack.prod.conf.js +++ b/template/build/webpack.prod.conf.js @@ -25,7 +25,7 @@ const 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') }, plugins: [ // http://vuejs.github.io/vue-loader/en/workflow/production.html From 1021801ccd0385507feaf4ac6313bd852ff37054 Mon Sep 17 00:00:00 2001 From: SidKwok Date: Thu, 16 Nov 2017 14:48:42 +0800 Subject: [PATCH 2/7] fix typo --- template/config/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/template/config/index.js b/template/config/index.js index cb24cb81bb..964b4112c2 100644 --- a/template/config/index.js +++ b/template/config/index.js @@ -14,7 +14,7 @@ module.exports = { // Various Dev Server settings host: 'localhost', // can be overwritten by process.env.HOST - port: 8080, // can be overwritten by process.env.HOST, if port is in use, a free one will be determined + port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, notifyOnErrors: true, @@ -47,7 +47,7 @@ module.exports = { // just be aware of this issue when enabling this option. cssSourceMap: false, }, - + build: { // Template for index.html index: path.resolve(__dirname, '../dist/index.html'), @@ -64,14 +64,14 @@ module.exports = { productionSourceMap: true, // https://webpack.js.org/configuration/devtool/#production devtool: '#source-map', - + // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin productionGzip: false, productionGzipExtensions: ['js', 'css'], - + // Run the build command with an extra argument to // View the bundle analyzer report after build finishes: // `npm run build --report` From e4ad0583211cd3cc80a475f50cd8c5b1de0d54e5 Mon Sep 17 00:00:00 2001 From: SidKwok Date: Thu, 16 Nov 2017 15:00:15 +0800 Subject: [PATCH 3/7] remove env in `.babelrc` when not using unit or e2e --- template/.babelrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/.babelrc b/template/.babelrc index 050e00e28c..5bd3f4a178 100644 --- a/template/.babelrc +++ b/template/.babelrc @@ -5,12 +5,12 @@ }], "stage-2" ], - "plugins": ["transform-runtime"], + "plugins": ["transform-runtime"]{{#if_or unit e2e}}, "env": { "test": { "presets": ["env", "stage-2"]{{#if_eq runner "karma"}}, "plugins": ["istanbul"] {{/if_eq}} } - } + }{{/if_or}} } From 7b805e1f6fe20b1f815592b17881d8f0f7883146 Mon Sep 17 00:00:00 2001 From: SidKwok Date: Thu, 16 Nov 2017 15:03:27 +0800 Subject: [PATCH 4/7] remove `webpack.test.conf.js` when not using unit or e2e --- meta.js | 1 + 1 file changed, 1 insertion(+) diff --git a/meta.js b/meta.js index 6f7b0f80d8..e4785d0832 100644 --- a/meta.js +++ b/meta.js @@ -105,6 +105,7 @@ module.exports = { ".eslintrc.js": "lint", ".eslintignore": "lint", "config/test.env.js": "unit || e2e", + "build/webpack.test.conf.js": "unit || e2e", "test/unit/**/*": "unit", "test/unit/index.js": "unit && runner === 'karma'", "test/unit/karma.conf.js": "unit && runner === 'karma'", From 7a615b7a3fb81d551594fe49f36559c6b682440d Mon Sep 17 00:00:00 2001 From: SidKwok Date: Thu, 16 Nov 2017 15:04:45 +0800 Subject: [PATCH 5/7] remove extra space in `.babelrc` --- template/.babelrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/template/.babelrc b/template/.babelrc index 5bd3f4a178..953e101125 100644 --- a/template/.babelrc +++ b/template/.babelrc @@ -9,8 +9,7 @@ "env": { "test": { "presets": ["env", "stage-2"]{{#if_eq runner "karma"}}, - "plugins": ["istanbul"] - {{/if_eq}} + "plugins": ["istanbul"]{{/if_eq}} } }{{/if_or}} } From ac8f3776cb67b350cfb474802702790bb86fcce8 Mon Sep 17 00:00:00 2001 From: SidKwok Date: Thu, 16 Nov 2017 15:09:20 +0800 Subject: [PATCH 6/7] enable `compress` in devServer by default --- template/build/webpack.dev.conf.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/template/build/webpack.dev.conf.js b/template/build/webpack.dev.conf.js index d344b962b4..813a7b0ccd 100644 --- a/template/build/webpack.dev.conf.js +++ b/template/build/webpack.dev.conf.js @@ -14,12 +14,13 @@ const devWebpackConfig = merge(baseWebpackConfig, { }, // cheap-module-eval-source-map is faster for development devtool: config.dev.devtool, - + // these devServer options should be customized in /config/index.js devServer: { clientLogLevel: 'warning', historyApiFallback: true, hot: true, + compress: true, host: process.env.HOST || config.dev.host, port: process.env.PORT || config.dev.port, open: config.dev.autoOpenBrowser, @@ -37,7 +38,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { plugins: [ new webpack.DefinePlugin({ 'process.env': require('../config/dev.env') - }), + }), new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. new webpack.NoEmitOnErrorsPlugin(), From 53ca3a98ecd10a6ea28fda483e49a83cd749f4b1 Mon Sep 17 00:00:00 2001 From: SidKwok Date: Thu, 16 Nov 2017 18:42:03 +0800 Subject: [PATCH 7/7] remove `webpack.test.conf.js` when not using unit(karma) or e2e --- meta.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta.js b/meta.js index e4785d0832..07d1b18303 100644 --- a/meta.js +++ b/meta.js @@ -105,7 +105,7 @@ module.exports = { ".eslintrc.js": "lint", ".eslintignore": "lint", "config/test.env.js": "unit || e2e", - "build/webpack.test.conf.js": "unit || e2e", + "build/webpack.test.conf.js": "e2e || (unit && runner === 'karma')", "test/unit/**/*": "unit", "test/unit/index.js": "unit && runner === 'karma'", "test/unit/karma.conf.js": "unit && runner === 'karma'",