postBuild.ts 504 B

123456789101112131415161718192021
  1. // #!/usr/bin/env node
  2. import { argv } from 'yargs';
  3. import { runBuildConfig } from './buildConf';
  4. import chalk from 'chalk';
  5. export const runBuild = async () => {
  6. try {
  7. const argvList = argv._;
  8. // Generate configuration file
  9. if (!argvList.includes('no-conf')) {
  10. await runBuildConfig();
  11. }
  12. console.log(chalk.green.bold('✨ vite build successfully!\n'));
  13. } catch (error) {
  14. console.log(chalk.red('vite build error:\n' + error));
  15. process.exit(1);
  16. }
  17. };
  18. runBuild();