build.js 618 B

123456789101112131415161718192021
  1. const { execSync} = require('child_process');
  2. const config = require('../package.json');
  3. // 执行命令并打印输出
  4. function runCommand(name, local) {
  5. try {
  6. execSync(`node ./scripts/build/nodeBuild.js ${name}.zip`, { stdio: 'inherit' });
  7. } catch (error) {
  8. console.error(`命令执行失败: ${error.message}`);
  9. process.exit(1);
  10. }
  11. }
  12. console.log(`----------------------------`)
  13. console.log(`准备开始打包: ${config.buildName}`);
  14. //打包官方版本
  15. runCommand(config.buildName, false);
  16. console.log(`----------------------------`)
  17. console.log('全部编译打包完成')