|
|
|
@ -21,7 +21,16 @@ const moveMarkdownFiles = (dir: string) => {
|
|
|
|
// 检查目标文件是否存在
|
|
|
|
// 检查目标文件是否存在
|
|
|
|
if (!fs.existsSync(distPath)) {
|
|
|
|
if (!fs.existsSync(distPath)) {
|
|
|
|
fs.copyFileSync(filePath, distPath);
|
|
|
|
fs.copyFileSync(filePath, distPath);
|
|
|
|
console.log(`自定义vite插件,复制 ${filePath} 到 ${distPath}`);
|
|
|
|
console.log(`自定义vite插件,复制 ${filePath} 到 ${distPath}(新增)`);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 比较文件大小
|
|
|
|
|
|
|
|
const sourceFileSize = stat.size;
|
|
|
|
|
|
|
|
const distFileSize = fs.statSync(distPath).size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sourceFileSize !== distFileSize) {
|
|
|
|
|
|
|
|
fs.copyFileSync(filePath, distPath);
|
|
|
|
|
|
|
|
console.log(`自定义vite插件,复制 ${filePath} 到 ${distPath}(文件大小不一致)`);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|