Blame view

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

import { runBuildConfig } from './buildConf';
4
import chalk from 'chalk';
5
vben authored
6
7
import pkg from '../../package.json';
8
export const runBuild = async () => {
9
  try {
Vben authored
10
    const argvList = process.argv.splice(2);
11
12

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