release fa common

Signed-off-by: houhaoyu <houhaoyu@huawei.com>
Change-Id: Ic90f65899189258f21c2796c85b08279aad9634b
This commit is contained in:
houhaoyu
2022-08-19 13:39:48 +08:00
parent 42ec2eb644
commit eff0564ca2
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ class ResultStates {
`if (commonCachedModule) { return commonCachedModule.exports; }\n` +
source.replace('// Execute the module function',
`if (globalThis["__common_module_cache__${process.env.hashProjectPath}"]` +
` && moduleId.indexOf("?name=") < 0 && ` +
` && String(moduleId).indexOf("?name=") < 0 && ` +
`Object.keys(globalThis["__common_module_cache__${process.env.hashProjectPath}"])` +
`.indexOf(moduleId) >= 0) {\n` +
` globalThis["__common_module_cache__${process.env.hashProjectPath}"]` +
+7 -2
View File
@@ -347,7 +347,12 @@ module.exports = (env) => {
}
if (env.buildMode === 'release') {
config.mode = 'production'
config.optimization = {
if (process.env.compileMode !== 'moduleJson' && process.env.abilityType === 'page') {
config.optimization = config.optimization;
} else {
config.optimization = {};
}
Object.assign(config.optimization, {
minimize: true,
minimizer: [
new TerserPlugin({
@@ -368,7 +373,7 @@ module.exports = (env) => {
},
})
]
}
})
config.output.sourceMapFilename = '_releaseMap/[name].js.map'
}
}