From 36a553236aa5811ea1fb1ecef0fb50f97047f75b Mon Sep 17 00:00:00 2001 From: Clark Du Date: Fri, 8 Sep 2017 12:07:08 +0800 Subject: [PATCH 1/4] fix global declaration in test Signed-off-by: Clark Du --- examples/typescript/modules/typescript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/typescript/modules/typescript.js b/examples/typescript/modules/typescript.js index ec98f8fd26..a45d341b89 100644 --- a/examples/typescript/modules/typescript.js +++ b/examples/typescript/modules/typescript.js @@ -7,7 +7,7 @@ module.exports = function (options) { loader: 'ts-loader' }) // Add TypeScript loader for vue files - for (rule of config.module.rules) { + for (let rule of config.module.rules) { if (rule.loader === 'vue-loader') { rule.query.loaders.ts = 'ts-loader?{"appendTsSuffixTo":["\\\\.vue$"]}' } From 1e0c807341dcc908df726080831d1175f8ddd2e0 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Fri, 8 Sep 2017 12:09:11 +0800 Subject: [PATCH 2/4] remove condition because dev is always true Signed-off-by: Clark Du --- examples/custom-build/nuxt.config.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/custom-build/nuxt.config.js b/examples/custom-build/nuxt.config.js index 5feedeaaef..7f63c66e5c 100644 --- a/examples/custom-build/nuxt.config.js +++ b/examples/custom-build/nuxt.config.js @@ -1,15 +1,15 @@ module.exports = { build: { filenames: { - css: 'styles.[chunkhash].css', // default: common.[chunkhash].css - manifest: 'manifest.[hash].js', // default: manifest.[hash].js - vendor: 'vendor.[hash].js', // default: vendor.bundle.[hash].js - app: 'app.[chunkhash].js' // default: nuxt.bundle.[chunkhash].js + css: 'styles.[chunkhash].css', // default: common.[chunkhash].css + manifest: 'manifest.[hash].js', // default: manifest.[hash].js + vendor: 'vendor.[hash].js', // default: vendor.bundle.[hash].js + app: 'app.[chunkhash].js' // default: nuxt.bundle.[chunkhash].js }, vendor: ['lodash'], extend (config, { dev }) { if (dev) { - config.devtool = (dev ? 'eval-source-map' : false) + config.devtool = 'eval-source-map' } const urlLoader = config.module.rules.find((loader) => loader.loader === 'url-loader') // Increase limit to 100KO From eae828ccc6cece9501fc2a6f123aef98b2b60a8c Mon Sep 17 00:00:00 2001 From: Clark Du Date: Fri, 8 Sep 2017 12:10:57 +0800 Subject: [PATCH 3/4] remove condition due to 'this.options.dev' is always false Signed-off-by: Clark Du --- lib/core/renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/renderer.js b/lib/core/renderer.js index 9a8bed02ea..d61a58c7c2 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -243,7 +243,7 @@ export default class Renderer extends Tapable { path: this.publicPath, handler: serveStatic(distDir, { index: false, // Don't serve index.html template - maxAge: (this.options.dev ? 0 : '1y') // 1 year in production + maxAge: '1y' // 1 year in production }) }) } From afc756f6946870ecaf25f9f7d4a8633f7900bdb3 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Fri, 8 Sep 2017 12:15:29 +0800 Subject: [PATCH 4/4] move up error print becuse it never be called Signed-off-by: Clark Du --- lib/builder/builder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index ed09d87f27..cf1de02253 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -486,9 +486,9 @@ export default class Builder extends Tapable { compiler.run((err, stats) => { /* istanbul ignore if */ if (err) { + console.error(err) // eslint-disable-line no-console return reject(err) } - if (err) return console.error(err) // eslint-disable-line no-console // Show build stats for production console.log(stats.toString(this.webpackStats)) // eslint-disable-line no-console