update ace-loader/src/resource-plugin.js.

Signed-off-by: 卡哥 <lizhouze@huawei.com>
This commit is contained in:
卡哥 2023-01-05 11:34:47 +00:00 committed by Gitee
parent dd89005908
commit 8979d48db4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -178,7 +178,8 @@ class ResourcePlugin {
function checkRemove(comp) {
const removedFiles = comp.removedFiles || [];
removedFiles.forEach(file => {
if (file.indexOf(process.env.projectPath) > -1) {
if (file.indexOf(process.env.projectPath) > -1 && path.extname(file) === '.json' &&
file.indexOf('i18n') > -1) {
const buildFilePath = file.replace(process.env.projectPath, process.env.buildPath);
if (fs.existsSync(buildFilePath)) {
fs.unlinkSync(buildFilePath);