Blame view

build/script/postBuild.ts 557 Bytes
1
2
3
4
// #!/usr/bin/env node

import { argv } from 'yargs';
import { runBuildConfig } from './buildConf';
5
import chalk from 'chalk';
6
vben authored
7
8
import pkg from '../../package.json';
9
export const runBuild = async () => {
10
11
12
13
14
15
16
  try {
    const argvList = argv._;

    // Generate configuration file
    if (!argvList.includes('no-conf')) {
      await runBuildConfig();
    }
Vben authored
17
vben authored
18
    console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
19
  } catch (error) {
20
    console.log(chalk.red('vite build error:\n' + error));
21
22
23
    process.exit(1);
  }
};
vben authored
24
runBuild();