mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-15 04:02:10 +08:00
优化代码
This commit is contained in:
@@ -40,10 +40,6 @@ class codeCompress {
|
||||
fsPro.copySync(codeDirPath, targetDir);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,24 +95,5 @@ class codeCompress {
|
||||
}
|
||||
|
||||
|
||||
const sourceDir = path.normalize(distDir);
|
||||
const targetDir = path.normalize('./app/public');
|
||||
const sourceIndexFile = path.normalize(sourceDir + '/index.html');
|
||||
const targetIndexFile = path.normalize( './app/view/index.ejs');
|
||||
if (!fileExist(sourceIndexFile)) {
|
||||
console.log('[electron] [replace_dist] ERROR source dir is empty!!!');
|
||||
return
|
||||
}
|
||||
|
||||
console.log('[electron] [replace_dist] delete target dir:', targetDir);
|
||||
fs.rmdirSync(targetDir, {recursive: true});
|
||||
|
||||
console.log('[electron] [replace_dist] copy :', sourceDir);
|
||||
fsPro.copySync(sourceDir, targetDir);
|
||||
|
||||
// replace ejs
|
||||
fsPro.copySync(sourceIndexFile, targetIndexFile);
|
||||
console.log('[electron] [replace_dist] replace index.ejs');
|
||||
|
||||
console.log('[electron] [replace_dist] end');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user