From 496022215291862a1746d8ceeb33e226b9955a05 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Sat, 27 Aug 2022 12:06:19 +0800 Subject: [PATCH] Fix clean webpack of esmodule Signed-off-by: zhangrengao Change-Id: Id951b6b44c02dd87fa4c519dd87a98cb9c359d74 --- compiler/src/gen_abc_plugin.ts | 1 + compiler/webpack.config.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/compiler/src/gen_abc_plugin.ts b/compiler/src/gen_abc_plugin.ts index 5b11e15..30dc6c0 100644 --- a/compiler/src/gen_abc_plugin.ts +++ b/compiler/src/gen_abc_plugin.ts @@ -143,6 +143,7 @@ export class GenAbcPlugin { } if (projectConfig.compileMode === ESMODULE) { + removeDir(output); removeDir(projectConfig.nodeModulesPath); } diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index ebb7678..a9c2391 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -346,6 +346,9 @@ function setGenAbcPlugin(env, config) { } function setCleanWebpackPlugin(workerFile, config) { + if (projectConfig.compileMode === 'esmodule') { + return; + } let cleanPath = []; cleanPath.push(projectConfig.buildPath); if (workerFile) {