2020-10-24 15:34:43 +08:00
|
|
|
import { readdirSync } from 'fs';
|
|
|
|
import { join } from 'path';
|
|
|
|
|
|
|
|
// utils must build before core
|
|
|
|
// runtime must build before renderer-react
|
|
|
|
const headPkgs = [
|
2021-12-03 11:42:24 +08:00
|
|
|
'utils',
|
2020-10-24 15:34:43 +08:00
|
|
|
'database',
|
|
|
|
'resourcer',
|
|
|
|
'actions',
|
2020-11-11 15:23:39 +08:00
|
|
|
'client',
|
2021-12-03 11:42:24 +08:00
|
|
|
'server',
|
2020-10-24 15:34:43 +08:00
|
|
|
];
|
|
|
|
const tailPkgs = [];
|
|
|
|
const otherPkgs = readdirSync(join(__dirname, 'packages')).filter(
|
|
|
|
(pkg) => {
|
2020-11-11 15:23:39 +08:00
|
|
|
return !['father-build', 'app'].includes(pkg) && pkg.charAt(0) !== '.' && !headPkgs.includes(pkg) && !tailPkgs.includes(pkg)
|
2020-10-24 15:34:43 +08:00
|
|
|
},
|
|
|
|
);
|
|
|
|
|
2020-12-24 07:35:53 +08:00
|
|
|
let pkgs = [];
|
|
|
|
|
|
|
|
if (process.argv.length > 2) {
|
|
|
|
pkgs = process.argv;
|
|
|
|
pkgs.shift();
|
|
|
|
pkgs.shift();
|
|
|
|
} else {
|
|
|
|
pkgs = [...headPkgs, ...otherPkgs, ...tailPkgs];
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(pkgs);
|
|
|
|
|
2020-10-24 15:34:43 +08:00
|
|
|
export default {
|
|
|
|
target: 'node',
|
|
|
|
cjs: { type: 'babel', lazy: true },
|
|
|
|
// disableTypeCheck: true,
|
2020-12-24 07:35:53 +08:00
|
|
|
pkgs,
|
2020-10-24 15:34:43 +08:00
|
|
|
};
|