mirror of
https://gitee.com/openharmony/developtools_ace_js2bundle
synced 2024-11-27 01:20:27 +00:00
update ace-loader/src/resource-plugin.js.
Signed-off-by: 卡哥 <lizhouze@huawei.com>
This commit is contained in:
parent
0f5cf42a9c
commit
bb993991a2
@ -140,16 +140,7 @@ class ResourcePlugin {
|
||||
});
|
||||
compiler.hooks.watchRun.tap('i18n', (comp) => {
|
||||
comp.removedFiles = comp.removedFiles || [];
|
||||
if (comp.removedFiles.length > 0) {
|
||||
comp.removedFiles.forEach(file => {
|
||||
if (file.indexOf(process.env.projectPath) > -1) {
|
||||
const buildFilePath = file.replace(process.env.projectPath, process.env.buildPath);
|
||||
if (fs.existsSync(buildFilePath)) {
|
||||
fs.unlinkSync(buildFilePath);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
checkRemove(comp.removedFiles);
|
||||
});
|
||||
compiler.hooks.normalModuleFactory.tap('OtherEntryOptionPlugin', () => {
|
||||
if (process.env.abilityType === 'testrunner') {
|
||||
@ -188,6 +179,19 @@ class ResourcePlugin {
|
||||
}
|
||||
}
|
||||
|
||||
function checkRemove(removedFiles) {
|
||||
if (removedFiles.length > 0) {
|
||||
removedFiles.forEach(file => {
|
||||
if (file.indexOf(process.env.projectPath) > -1) {
|
||||
const buildFilePath = file.replace(process.env.projectPath, process.env.buildPath);
|
||||
if (fs.existsSync(buildFilePath)) {
|
||||
fs.unlinkSync(buildFilePath);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function copyManifest() {
|
||||
copyFile(manifestFilePath, path.join(output, 'manifest.json'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user