From 41f15641cf2a866106edbc7592f36d8eb6fc310c Mon Sep 17 00:00:00 2001 From: shaodahong Date: Wed, 23 Sep 2020 13:40:37 +0800 Subject: [PATCH] fix: source map cause build fail --- bin/webpack/baseConfig.js | 1 - bin/webpack/prodConfig.js | 2 +- package.json | 2 +- yarn.lock | 18 +++++++++--------- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/bin/webpack/baseConfig.js b/bin/webpack/baseConfig.js index 9f3e276f..4411cd5b 100644 --- a/bin/webpack/baseConfig.js +++ b/bin/webpack/baseConfig.js @@ -158,7 +158,6 @@ const getBaseConfig = async () => { // 提取公共样式 new MiniCssExtractPlugin({ filename: isDev ? 'css/[name].css' : 'css/[name].[contenthash:7].css', - allChunks: true, ignoreOrder: true, }), diff --git a/bin/webpack/prodConfig.js b/bin/webpack/prodConfig.js index 979a8ca7..35487e88 100644 --- a/bin/webpack/prodConfig.js +++ b/bin/webpack/prodConfig.js @@ -10,7 +10,7 @@ module.exports = async function getProdConfig(options) { const baseConfig = await getBaseConfig(options) return merge(baseConfig, { - devtool: config[process.env.PACKAGE].productionSourceMap ? 'source-map' : false, + devtool: config[process.env.PACKAGE].productionSourceMap ? 'cheap-module-source-map' : false, optimization: { minimizer: [ new OptimizeCSSAssetsPlugin({ diff --git a/package.json b/package.json index 54a39160..5512212d 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "sass-loader": "^10.0.2", "source-map-url": "^0.4.0", "style-loader": "^1.2.1", - "terser-webpack-plugin": "^4.2.1", + "terser-webpack-plugin": "^4.2.2", "thread-loader": "^3.0.0", "ts-loader": "^8.0.3", "url-loader": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index c067ae02..cd8e80ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8980,10 +8980,10 @@ terser-webpack-plugin@^4.1.0: terser "^5.0.0" webpack-sources "^1.4.3" -terser-webpack-plugin@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.2.1.tgz#44b88ef4d7443129fb136a68b5ec3e80d63ec471" - integrity sha512-D0IZQNl1ZN/JivFNDFzOeU2Bk2LdQQESHJhKTHsodpUmISkaeRwVFk7gzHzX4OuQwanDGelOxIEsBt1SZ+s6nA== +terser-webpack-plugin@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.2.2.tgz#d86200c700053bba637913fe4310ba1bdeb5568e" + integrity sha512-3qAQpykRTD5DReLu5/cwpsg7EZFzP3Q0Hp2XUWJUw2mpq2jfgOKTZr8IZKKnNieRVVo1UauROTdhbQJZveGKtQ== dependencies: cacache "^15.0.5" find-cache-dir "^3.3.1" @@ -8992,7 +8992,7 @@ terser-webpack-plugin@^4.2.1: schema-utils "^2.7.1" serialize-javascript "^5.0.1" source-map "^0.6.1" - terser "^5.3.1" + terser "^5.3.2" webpack-sources "^1.4.3" terser@^4.6.3: @@ -9013,10 +9013,10 @@ terser@^5.0.0: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.3.1.tgz#f50fe20ab48b15234fe9bdd86b10148ad5fca787" - integrity sha512-yD80f4hdwCWTH5mojzxe1q8bN1oJbsK/vfJGLcPZM/fl+/jItIVNKhFIHqqR71OipFWMLgj3Kc+GIp6CeIqfnA== +terser@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.3.2.tgz#f4bea90eb92945b2a028ceef79181b9bb586e7af" + integrity sha512-H67sydwBz5jCUA32ZRL319ULu+Su1cAoZnnc+lXnenGRYWyLE3Scgkt8mNoAsMx0h5kdo758zdoS0LG9rYZXDQ== dependencies: commander "^2.20.0" source-map "~0.6.1"