From 0f744ef1e059c4af5fb45a8677f700554b4f8340 Mon Sep 17 00:00:00 2001 From: zhangbingce Date: Wed, 13 Oct 2021 14:56:52 +0800 Subject: [PATCH] fixed c5d90b6 from https://gitee.com/zhangbingce/developtools_ace-ets2bundle/pulls/50 delete ?entry in sourcemap Signed-off-by: zhangbingce Change-Id: Id54aa48f2541f4c5e83bf84b79820bc8435cbd8c --- compiler/src/compile_info.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index f8a1d234d..5176ede3e 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -64,6 +64,17 @@ export class ResultStates { private reset: string = '\u001b[39m'; public apply(compiler: Compiler): void { + compiler.hooks.compilation.tap("SourcemapFixer", compilation => { + compilation.hooks.afterProcessAssets.tap("SourcemapFixer", assets => { + Reflect.ownKeys(assets).forEach(key => { + if (/\.map/.test(key.toString())) { + assets[key]._value = assets[key]._value.toString().replace('.ets?entry', '.ets'); + } + }); + } + ); + }); + compiler.hooks.done.tap('Result States', (stats: Stats) => { this.mStats = stats; this.warningCount = 0; -- Gitee