|
|
@@ -2,9 +2,19 @@
|
|
|
|
|
|
import { runBuildConfig } from './buildConf';
|
|
|
import chalk from 'chalk';
|
|
|
-
|
|
|
+const fs = require('fs');
|
|
|
import pkg from '../../package.json';
|
|
|
|
|
|
+function removeFile(filename) {
|
|
|
+ fs.unlink(filename, (err) => {
|
|
|
+ if (err) {
|
|
|
+ console.error('删除本地配置文件:', err);
|
|
|
+ } else {
|
|
|
+ console.log(`删除本地配置文件: ${filename} 成功!`);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
export const runBuild = async () => {
|
|
|
try {
|
|
|
const argvList = process.argv.splice(2);
|
|
|
@@ -15,6 +25,7 @@ export const runBuild = async () => {
|
|
|
}
|
|
|
|
|
|
console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
|
|
|
+ removeFile('./target/dist/_app.config.js');
|
|
|
} catch (error) {
|
|
|
console.log(chalk.red('vite build error:\n' + error));
|
|
|
process.exit(1);
|