@lonu/stc
Version:
A tool for converting OpenApi/Swagger/Apifox into code.
16 lines (15 loc) • 447 B
JavaScript
import "../_dnt.polyfills.js";
import { main, resolveOptions } from "./cli.js";
import { start } from "./app.js";
import { runOnce, startWatch } from "./watcher.js";
const result = await main();
if (result.options.watch) {
// 监听模式:首次生成失败不中断,继续监听
await runOnce(result.options);
await startWatch(result, resolveOptions);
}
else {
// 启动
await start(result.options);
}