2021-10-20 06:32:09 +00:00
|
|
|
// #!/usr/bin/env node
|
|
|
|
|
|
|
|
import { runBuildConfig } from './buildConf';
|
2022-09-22 06:04:09 +00:00
|
|
|
import colors from 'picocolors';
|
2021-10-20 06:32:09 +00: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')) {
|
2022-06-10 02:44:44 +00:00
|
|
|
runBuildConfig();
|
2021-10-20 06:32:09 +00:00
|
|
|
}
|
|
|
|
|
2022-09-22 06:04:09 +00:00
|
|
|
console.log(`✨ ${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
|
2021-10-20 06:32:09 +00:00
|
|
|
} catch (error) {
|
2022-09-22 06:04:09 +00:00
|
|
|
console.log(colors.red('vite build error:\n' + error));
|
2021-10-20 06:32:09 +00:00
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
runBuild();
|