加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
deps-gen.js 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
王立帮 提交于 2023-09-21 23:23 . Update: 添加NW.js打包脚本
const fs = require('fs');
const fs_extra = require('fs-extra');
const fs_plus = require('fs-plus');
const build_deps = require('./build/build-deps.js');
const path = require('path');
const config = {
"workPath": __dirname,
"fileIgnore": [
path.resolve(__dirname, './common/modules/mixly-modules/mixly.min.js')
],
"dirIgnore": [
]
};
const needBuildDirList = [
__dirname + '/mixly-sw/mixly-modules/',
__dirname + '/common/modules/mixly-modules/'
];
const generateDeps = () => {
for (let needBuildDir of needBuildDirList) {
let fileIgnore = [];
let dirIgnore = [];
if (typeof config.fileIgnore === 'object') {
for (let data of config.fileIgnore) {
fileIgnore.push(path.resolve(needBuildDir, data));
}
}
if (typeof config.dirIgnore === 'object') {
for (let data of config.dirIgnore) {
dirIgnore.push(path.resolve(needBuildDir, data));
}
}
let outputConfig = [];
console.log('deps.json生成中...');
const ignore = {
dir: dirIgnore,
file: fileIgnore
};
outputConfig = build_deps.generate(needBuildDir, ignore);
fs_extra.outputJsonSync(path.join(needBuildDir, 'deps.json'), outputConfig, {
spaces: ' '
});
console.log(path.join(needBuildDir, 'deps.json') + '生成成功');
}
}
generateDeps();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化