From 32a470ee7335ac03334670a098ee8b61202e4ea6 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Fri, 4 Mar 2022 18:21:45 +0800 Subject: [PATCH] laibo2@huawei.com Signed-off-by: laibo102 Change-Id: Ied216f3587c317cac80fb4b31d9cbed50d645102 --- compiler/main.js | 2 +- compiler/src/compile_info.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 2ca5730..372ce24 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -195,7 +195,7 @@ function loadWorker(projectConfig) { const workerConfig = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString()); workerConfig.workers.forEach(worker => { if (!/\.(ts|js)$/.test(worker)) { - worker += '.ts' + worker += '.ts'; } const relativePath = path.relative(projectConfig.projectPath, worker); if (filterWorker(relativePath)) { diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 6e5fdb4..4312b7f 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -75,7 +75,6 @@ export class ResultStates { private modulePaths: Set = new Set([]); public apply(compiler: Compiler): void { - compiler.hooks.compilation.tap('SourcemapFixer', compilation => { compilation.hooks.afterProcessAssets.tap('SourcemapFixer', assets => { Reflect.ownKeys(assets).forEach(key => { @@ -110,14 +109,14 @@ export class ResultStates { stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS }, (assets) => { - const GLOBAL_COMMON_MODULE_CACHE = ` + const GLOBAL_COMMON_MODULE_CACHE = ` globalThis["__common_module_cache__${projectConfig.hashProjectPath}"] =` + ` globalThis["__common_module_cache__${projectConfig.hashProjectPath}"] || {}; globalThis["webpackChunk${projectConfig.hashProjectPath}"].forEach((item)=> { Object.keys(item[1]).forEach((element) => { globalThis["__common_module_cache__${projectConfig.hashProjectPath}"][element] = null; }) - });` + });`; if (assets['commons.js']) { assets['commons.js'] = new CachedSource(