diff --git a/packages/@vue/cli-service/lib/config/base.js b/packages/@vue/cli-service/lib/config/base.js index 79bcffe1ab..9ff1411c02 100644 --- a/packages/@vue/cli-service/lib/config/base.js +++ b/packages/@vue/cli-service/lib/config/base.js @@ -3,7 +3,6 @@ module.exports = (api, options) => { const resolveLocal = require('../util/resolveLocal') const getAssetPath = require('../util/getAssetPath') const inlineLimit = 10000 - const useThreads = process.env.NODE_ENV === 'production' && options.parallel webpackConfig .context(api.service.context) @@ -44,29 +43,22 @@ module.exports = (api, options) => { // vue-loader -------------------------------------------------------------- const { genCacheConfig } = require('@vue/cli-shared-utils') + const vueLoaderCacheConfig = genCacheConfig(api, options, 'vue-loader') - const vueRule = webpackConfig.module + webpackConfig.module .rule('vue') .test(/\.vue$/) .use('cache-loader') .loader('cache-loader') - .options(genCacheConfig(api, options, 'vue-loader')) + .options(vueLoaderCacheConfig) .end() - - if (useThreads) { - vueRule - .use('thread-loader') - .loader('thread-loader') - } - - vueRule - .use('vue-loader') - .loader('vue-loader') - .options({ - compilerOptions: { - preserveWhitespace: false - } - }) + .use('vue-loader') + .loader('vue-loader') + .options(Object.assign({ + compilerOptions: { + preserveWhitespace: false + } + }, vueLoaderCacheConfig)) webpackConfig .plugin('vue-loader') diff --git a/packages/@vue/cli-service/package.json b/packages/@vue/cli-service/package.json index d9485cab87..17776b1512 100644 --- a/packages/@vue/cli-service/package.json +++ b/packages/@vue/cli-service/package.json @@ -56,7 +56,7 @@ "thread-loader": "^1.1.5", "uglifyjs-webpack-plugin": "^1.2.5", "url-loader": "^1.0.1", - "vue-loader": "^15.1.0", + "vue-loader": "^15.2.0", "vue-template-compiler": "^2.5.16", "webpack": "^4.8.2", "webpack-chain": "^4.8.0", diff --git a/yarn.lock b/yarn.lock index 8b5cbfe223..0fd14ec857 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10669,9 +10669,9 @@ vue-jest@^2.6.0: tsconfig "^7.0.0" vue-template-es2015-compiler "^1.6.0" -vue-loader@^15.1.0: - version "15.1.0" - resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.1.0.tgz#82a2a5c310951aba17ad5d8680fe016c77d37e80" +vue-loader@^15.2.0: + version "15.2.0" + resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.2.0.tgz#5a8138e490a1040942d2f10ae68fa72b5a923364" dependencies: "@vue/component-compiler-utils" "^1.2.1" hash-sum "^1.0.2"