2022-11-24 23:37:34 +08:00
|
|
|
// #!/usr/bin/env node
|
|
|
|
|
|
|
|
import { runBuildConfig } from './buildConf';
|
|
|
|
import chalk from 'chalk';
|
2024-09-26 17:28:56 +08:00
|
|
|
import process from 'node:process'
|
2022-11-24 23:37:34 +08:00
|
|
|
import pkg from '../../package.json';
|
|
|
|
|
|
|
|
export const runBuild = async () => {
|
|
|
|
try {
|
|
|
|
const argvList = process.argv.splice(2);
|
|
|
|
|
|
|
|
// Generate configuration file
|
|
|
|
if (!argvList.includes('disabled-config')) {
|
|
|
|
await runBuildConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
|
|
|
|
} catch (error) {
|
|
|
|
console.log(chalk.red('vite build error:\n' + error));
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
};
|
2024-09-26 17:28:56 +08:00
|
|
|
runBuild().then();
|