wujingjing
2024-09-05 e3674ccc57f6d4afe8dbd77b2d96d81777e2422f
scripts/build.js
@@ -1,4 +1,6 @@
const path = require('path');
const fs = require('fs-extra');
const {
   copyFile,
   distDir,
@@ -11,7 +13,10 @@
   firstCustomerName,
   checkCustomer,
   formatDate,
   logSuccess
   logSuccess,
   logWarn,
   rootDir,
   publicDir
} = require('./helper');
const { execSync } = require('child_process');
if (customerList?.length !== 1) {
@@ -20,6 +25,23 @@
}
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();
try {