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

Signed-off-by: 卡哥 <lizhouze@huawei.com>
This commit is contained in:
卡哥 2023-01-04 02:14:17 +00:00 committed by Gitee
parent bb993991a2
commit 83ed4d6890
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -126,17 +126,7 @@ class ResourcePlugin {
}
apply(compiler) {
compiler.hooks.beforeCompile.tap('resource Copy', () => {
if (multiResourceBuild.value) {
const res = multiResourceBuild.value.res;
if (res) {
res.forEach(item => {
circularFile(path.resolve(input, item), path.resolve(output, item), '');
})
}
} else {
circularFile(input, output, '');
}
circularFile(input, output, '../share');
resourceCopy();
});
compiler.hooks.watchRun.tap('i18n', (comp) => {
comp.removedFiles = comp.removedFiles || [];
@ -179,6 +169,20 @@ class ResourcePlugin {
}
}
function resourceCopy() {
if (multiResourceBuild.value) {
const res = multiResourceBuild.value.res;
if (res) {
res.forEach(item => {
circularFile(path.resolve(input, item), path.resolve(output, item), '');
})
}
} else {
circularFile(input, output, '');
}
circularFile(input, output, '../share');
}
function checkRemove(removedFiles) {
if (removedFiles.length > 0) {
removedFiles.forEach(file => {