// 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 snows_l@163.com
* @Date: 2023-01-12 10:32:29
* @LastEditors: snows_l snows_l@163.com
* @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'
];
该脚本用于执行模块的依赖安装和构建过程。它遍历指定路径下的子项目,使用`yarninstall`和`yarnbuild`命令进行构建。文章提到了`sub.js`中导出的子应用名称列表,这些子应用包括adminparty、analyse等,表明这是一个多模块的项目管理场景。
318

被折叠的 条评论
为什么被折叠?



