delete ?entry in sourcemap

Signed-off-by: zhangbingce <zhangbingce@huawei.com>
Change-Id: Id54aa48f2541f4c5e83bf84b79820bc8435cbd8c
This commit is contained in:
zhangbingce
2021-10-13 14:56:52 +08:00
parent dd17815c8a
commit c5d90b6e3a
+11
View File
@@ -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;