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

25 lines
557 B
TypeScript
Raw Normal View History

// #!/usr/bin/env node
import { argv } from 'yargs';
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 {
const argvList = argv._;
// Generate configuration file
if (!argvList.includes('no-conf')) {
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();