2020-10-13 01:40:21 +08:00
|
|
|
// #!/usr/bin/env node
|
|
|
|
|
|
|
|
import { argv } from 'yargs';
|
|
|
|
import { runBuildConfig } from './buildConf';
|
2020-10-15 21:38:50 +08:00
|
|
|
import { errorConsole, successConsole } from '../utils';
|
2020-10-13 01:40:21 +08:00
|
|
|
|
2020-12-22 22:13:03 +08:00
|
|
|
export const runBuild = async () => {
|
2020-10-13 01:40:21 +08:00
|
|
|
try {
|
|
|
|
const argvList = argv._;
|
|
|
|
|
|
|
|
// Generate configuration file
|
|
|
|
if (!argvList.includes('no-conf')) {
|
|
|
|
await runBuildConfig();
|
|
|
|
}
|
|
|
|
successConsole('Vite Build successfully!');
|
|
|
|
} catch (error) {
|
|
|
|
errorConsole('Vite Build Error\n' + error);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
};
|
2020-10-26 21:45:43 +08:00
|
|
|
runBuild();
|