gf-vben-admin/build/script/postBuild.ts

24 lines
551 B
TypeScript
Raw Normal View History

// #!/usr/bin/env node
import { runBuildConfig } from './buildConf';
2021-02-04 22:00:25 +08:00
import chalk from 'chalk';
2021-02-08 23:59:47 +08:00
import pkg from '../../package.json';
export const runBuild = async () => {
try {
2021-03-26 21:16:08 +08:00
const argvList = process.argv.splice(2);
// Generate configuration file
2021-03-26 21:16:08 +08:00
if (!argvList.includes('disabled-config')) {
await runBuildConfig();
}
2021-02-25 20:17:08 +08:00
2021-02-08 23:59:47 +08:00
console.log(`${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
} catch (error) {
2021-02-04 22:00:25 +08:00
console.log(chalk.red('vite build error:\n' + error));
process.exit(1);
}
};
2020-10-26 21:45:43 +08:00
runBuild();