qiankunJs(基于spa的微服务框架)、安装主应用以及所有子应用脚本

// scripts

const subFiles = require('../sub.js');
const path = require('path');
const exec = require('child_process').exec;
const chalk = require('chalk');

function execute(cmd, item) {
  exec(cmd, function (error, stdout, stderr) {
    if (error) {
      console.error(error);
    } else {
      console.log(chalk.blue(`模块${item}依赖成功`));
    }
  });
}

function bootstrap(path, name) {
  execute(`cd ${path} && yarn install && yarn build`, name);
}
bootstrap(path.join(__dirname), '总项目!');
bootstrap(path.join(__dirname, '../package/portal'), 'portal');
subFiles.forEach(item => {
  bootstrap(path.join(__dirname, `../package/module/${item}`), item);
});

// sub.js 所有子应用的名称

/*
 * @Description: ------ 文件描述 ------
 * @Creater: snows_l [email protected]
 * @Date: 2023-01-12 10:32:29
 * @LastEditors: snows_l [email protected]
 * @LastEditTime: 2023-01-12 11:39:25
 * @FilePath: /lg-ebt-backend-vue-top2/sub.js
 */
module.exports = [
  'adminparty',
  'analyse',
  'asset',
  'base',
  'cparty',
  'finance',
  'iot',
  'media',
  'operation',
  'synergy',
  'system',
  'thirdserver',
  'buildingmanage'
];

猜你喜欢

转载自blog.csdn.net/snows_l/article/details/128827427