From c657967f96de3f3554f0c7757222db4553767812 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 23 Dec 2021 20:26:27 +0800 Subject: [PATCH] chore(h5): optimization.moduleIds = 'hashed' --- packages/uni-cli-shared/lib/cache.js | 2 +- packages/vue-cli-plugin-uni/lib/h5/index.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/uni-cli-shared/lib/cache.js b/packages/uni-cli-shared/lib/cache.js index cb666134a..e2f27650e 100644 --- a/packages/uni-cli-shared/lib/cache.js +++ b/packages/uni-cli-shared/lib/cache.js @@ -87,7 +87,7 @@ function updateComponentJson (name, jsonObj, usingComponents = true, type = 'Com const oldJsonObj = JSON.parse(oldJsonStr) jsonObj.usingComponents = oldJsonObj.usingComponents || {} jsonObj.usingAutoImportComponents = oldJsonObj.usingAutoImportComponents || {} - if(oldJsonObj.genericComponents) { + if (oldJsonObj.genericComponents) { jsonObj.genericComponents = oldJsonObj.genericComponents } if (oldJsonObj.usingGlobalComponents) { // 复制 global components(针对不支持全局 usingComponents 的平台) diff --git a/packages/vue-cli-plugin-uni/lib/h5/index.js b/packages/vue-cli-plugin-uni/lib/h5/index.js index 2072a04d4..82a26ba4f 100644 --- a/packages/vue-cli-plugin-uni/lib/h5/index.js +++ b/packages/vue-cli-plugin-uni/lib/h5/index.js @@ -155,6 +155,9 @@ module.exports = { } }, plugins, + optimization: { + moduleIds: 'hashed' + }, devServer: { watchOptions: require('../util').getWatchOptions() } -- GitLab