Vben
2021-03-26 e090689ef5c2d88aa19da994324561c26e37e17e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// #!/usr/bin/env node
 
import { runBuildConfig } from './buildConf';
import chalk from 'chalk';
 
import pkg from '../../package.json';
 
export const runBuild = async () => {
  try {
    const argvList = process.argv.splice(2);
 
    // Generate configuration file
    if (!argvList.includes('disabled-config')) {
      await runBuildConfig();
    }
 
    console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
  } catch (error) {
    console.log(chalk.red('vite build error:\n' + error));
    process.exit(1);
  }
};
runBuild();