mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 05:29:51 +00:00
build: vite.config.ts
This commit is contained in:
parent
2b1da81b98
commit
c40de5d3b2
@ -12,7 +12,7 @@ const preserveFilesPlugin = (filesToPreserve: string[]): Plugin => {
|
|||||||
// 在构建开始时将要保留的文件或目录移动到临时位置
|
// 在构建开始时将要保留的文件或目录移动到临时位置
|
||||||
filesToPreserve.forEach((file) => {
|
filesToPreserve.forEach((file) => {
|
||||||
const srcPath = path.resolve(__dirname, file);
|
const srcPath = path.resolve(__dirname, file);
|
||||||
const tempPath = path.resolve(__dirname, `temp_${file}`);
|
const tempPath = path.resolve(__dirname, `node_modules`, `.tmp`, `build_${file}`);
|
||||||
if (fs.existsSync(srcPath)) {
|
if (fs.existsSync(srcPath)) {
|
||||||
fs.moveSync(srcPath, tempPath, { overwrite: true });
|
fs.moveSync(srcPath, tempPath, { overwrite: true });
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ const preserveFilesPlugin = (filesToPreserve: string[]): Plugin => {
|
|||||||
// 在构建完成后将临时位置的文件或目录移回原来的位置
|
// 在构建完成后将临时位置的文件或目录移回原来的位置
|
||||||
filesToPreserve.forEach((file) => {
|
filesToPreserve.forEach((file) => {
|
||||||
const srcPath = path.resolve(__dirname, file);
|
const srcPath = path.resolve(__dirname, file);
|
||||||
const tempPath = path.resolve(__dirname, `temp_${file}`);
|
const tempPath = path.resolve(__dirname, `node_modules`, `.tmp`, `build_${file}`);
|
||||||
if (fs.existsSync(tempPath)) {
|
if (fs.existsSync(tempPath)) {
|
||||||
fs.moveSync(tempPath, srcPath, { overwrite: true });
|
fs.moveSync(tempPath, srcPath, { overwrite: true });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user