Signed-off-by: laibo102 <laibo2@huawei.com>
Change-Id: Ied216f3587c317cac80fb4b31d9cbed50d645102
This commit is contained in:
laibo102
2022-03-04 18:21:45 +08:00
parent 5b28e7f803
commit 32a470ee73
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -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)) {
+2 -3
View File
@@ -75,7 +75,6 @@ export class ResultStates {
private modulePaths: Set<string> = 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(