mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 18:40:22 +08:00
25 lines
623 B
TypeScript
25 lines
623 B
TypeScript
// #!/usr/bin/env node
|
|
|
|
import { argv } from 'yargs';
|
|
import { runBuildConfig } from './buildConf';
|
|
import { errorConsole, successConsole } from '../utils';
|
|
import { startGzipStyle } from '../vite/plugin/gzip/compress';
|
|
|
|
export const runBuild = async () => {
|
|
try {
|
|
const argvList = argv._;
|
|
|
|
// Generate configuration file
|
|
if (!argvList.includes('no-conf')) {
|
|
await runBuildConfig();
|
|
}
|
|
// await runUpdateHtml();
|
|
await startGzipStyle();
|
|
successConsole('Vite Build successfully!');
|
|
} catch (error) {
|
|
errorConsole('Vite Build Error\n' + error);
|
|
process.exit(1);
|
|
}
|
|
};
|
|
runBuild();
|