diff --git a/vue.config.js b/vue.config.js index 7da20a9..34fe9a1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -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}`);