mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 12:12:01 +08:00
chore: update npm script
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import chalk from 'chalk';
|
||||
import Koa from 'koa';
|
||||
import inquirer from 'inquirer';
|
||||
// import inquirer from 'inquirer';
|
||||
import staticServer from 'koa-static';
|
||||
import portfinder from 'portfinder';
|
||||
import { resolve } from 'path';
|
||||
import viteConfig from '../../vite.config';
|
||||
import { getIPAddress } from '../utils';
|
||||
import { runBuild } from './build';
|
||||
// import { runBuild } from './postBuild';
|
||||
|
||||
const BUILD = 1;
|
||||
const NO_BUILD = 2;
|
||||
// const BUILD = 1;
|
||||
// const NO_BUILD = 2;
|
||||
|
||||
// start server
|
||||
const startApp = () => {
|
||||
@@ -35,25 +35,25 @@ const startApp = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const runPreview = async () => {
|
||||
const prompt = inquirer.prompt({
|
||||
type: 'list',
|
||||
message: 'Please select a preview method',
|
||||
name: 'type',
|
||||
choices: [
|
||||
{
|
||||
name: 'Preview after packaging',
|
||||
value: BUILD,
|
||||
},
|
||||
{
|
||||
name: `No packaging, preview directly (need to have dist file after packaging)`,
|
||||
value: NO_BUILD,
|
||||
},
|
||||
],
|
||||
});
|
||||
const { type } = await prompt;
|
||||
if (type === BUILD) {
|
||||
await runBuild(true);
|
||||
}
|
||||
startApp();
|
||||
};
|
||||
// export const runPreview = async () => {
|
||||
// // const prompt = inquirer.prompt({
|
||||
// // type: 'list',
|
||||
// // message: 'Please select a preview method',
|
||||
// // name: 'type',
|
||||
// // choices: [
|
||||
// // {
|
||||
// // name: 'Preview after packaging',
|
||||
// // value: BUILD,
|
||||
// // },
|
||||
// // {
|
||||
// // name: `No packaging, preview directly (need to have dist file after packaging)`,
|
||||
// // value: NO_BUILD,
|
||||
// // },
|
||||
// // ],
|
||||
// // });
|
||||
// const { type } = await prompt;
|
||||
// if (type === BUILD) {
|
||||
// await runBuild(true);
|
||||
// }
|
||||
// };
|
||||
startApp();
|
||||
|
Reference in New Issue
Block a user