postBuild.ts 551 字节
Newer Older
1 2 3
// #!/usr/bin/env node

import { runBuildConfig } from './buildConf';
V
vben 已提交
4
import chalk from 'chalk';
5

V
vben 已提交
6 7
import pkg from '../../package.json';

8
export const runBuild = async () => {
9
  try {
V
Vben 已提交
10
    const argvList = process.argv.splice(2);
11 12

    // Generate configuration file
V
Vben 已提交
13
    if (!argvList.includes('disabled-config')) {
14 15
      await runBuildConfig();
    }
V
Vben 已提交
16

V
vben 已提交
17
    console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
18
  } catch (error) {
V
vben 已提交
19
    console.log(chalk.red('vite build error:\n' + error));
20 21 22
    process.exit(1);
  }
};
V
vben 已提交
23
runBuild();