feat: auto import route

This commit is contained in:
vben
2020-10-16 22:03:44 +08:00
parent aca07d4ca7
commit 8a1bfdf13d
20 changed files with 528 additions and 339 deletions

View File

@@ -1,12 +1,12 @@
import chalk from 'chalk';
import Koa from 'koa';
import inquirer from 'inquirer';
import { sh } from 'tasksfile';
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';
const BUILD = 1;
const NO_BUILD = 2;
@@ -53,10 +53,7 @@ export const runPreview = async () => {
});
const { type } = await prompt;
if (type === BUILD) {
await sh('npm run build', {
async: true,
nopipe: true,
});
runBuild();
}
startApp();
};