nebv
authored
|
1
2
3
4
|
// #!/usr/bin/env node
import { argv } from 'yargs';
import { runBuildConfig } from './buildConf';
|
vben
authored
|
5
|
import chalk from 'chalk';
|
nebv
authored
|
6
|
|
vben
authored
|
7
8
|
import pkg from '../../package.json';
|
vben
authored
|
9
|
export const runBuild = async () => {
|
nebv
authored
|
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!');
|
nebv
authored
|
19
|
} catch (error) {
|
vben
authored
|
20
|
console.log(chalk.red('vite build error:\n' + error));
|
nebv
authored
|
21
22
23
|
process.exit(1);
}
};
|
vben
authored
|
24
|
runBuild();
|