nebv
authored
|
1
2
3
4
|
// #!/usr/bin/env node
import { argv } from 'yargs';
import { runBuildConfig } from './buildConf';
|
vben
authored
|
5
|
import { errorConsole, successConsole } from '../utils';
|
vben
authored
|
6
|
import { startGzipStyle } from '../vite/plugin/gzip/compress';
|
nebv
authored
|
7
|
|
vben
authored
|
8
|
export const runBuild = async () => {
|
nebv
authored
|
9
10
11
12
13
14
15
|
try {
const argvList = argv._;
// Generate configuration file
if (!argvList.includes('no-conf')) {
await runBuildConfig();
}
|
vben
authored
|
16
|
// await runUpdateHtml();
|
vben
authored
|
17
|
await startGzipStyle();
|
nebv
authored
|
18
19
20
21
22
23
|
successConsole('Vite Build successfully!');
} catch (error) {
errorConsole('Vite Build Error\n' + error);
process.exit(1);
}
};
|
vben
authored
|
24
|
runBuild();
|