wujingjing
2025-01-13 0bb7dffa90bfa3bd5ad04b75da9c31d21347c668
scripts/build.js
@@ -16,31 +16,20 @@
   logSuccess,
   logWarn,
   rootDir,
   publicDir
   publicDir,
   changeBranch
} = require('./helper');
const { execSync } = require('child_process');
if (customerList?.length !== 1) {
   logError(`请正确使用命令 “npm run build customer”(目前只支持一次部署一个)`);
   exit(); // 退出脚本
}
checkCustomer('npm run build', firstCustomerName);
copyFile();
// 复制amis-editor 到 public文件夹中
const amisEditorPath = path.join(rootDir,'amis-editor');
const targetPath = path.join(publicDir,'amis-editor')
const isExist = fs.pathExistsSync(amisEditorPath);
if(!isExist){
   logWarn('amis-editor 不存在!');
}else{
   const isExist = fs.pathExistsSync(targetPath);
   if(!isExist){
      fs.mkdirSync(targetPath);
   }
   const res = fs.copySync(amisEditorPath,targetPath)
   res ?? logSuccess('========= 已集成 amis-editor =========')
}
// 更改 import.meta.glob
updateImportGlob();