H5发行打包完成后自动打开输出目录

This commit is contained in:
2026-05-20 11:32:06 +08:00
parent 31c6914880
commit 836eeb080e

View File

@@ -263,6 +263,15 @@ class VersionInjectPlugin {
try {
execSync(command, { stdio: 'inherit' });
console.log(`✅ H5 ZIP: ${zipFileName}`);
// 打包成功后默认打开输出目录
const openDir = h5Dir.replace(/'/g, "''");
if (process.platform === 'win32') {
execSync(`explorer "${openDir}"`, { stdio: 'ignore' });
} else {
execSync(`open "${openDir}"`, { stdio: 'ignore' });
}
// 删除已打包的源目录
// fs.rmSync(targetDir, { recursive: true, force: true });
// console.log(`[H5Zip] 已删除源目录: ${outputDirName}`);