UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

52 lines (51 loc) 1.37 kB
import { setServerGlobals } from "../server/setServerGlobals.native.js"; import { virtualEntryIdNative } from "../vite/plugins/virtualEntryConstants.native.js"; import { checkNodeVersion } from "./checkNodeVersion.native.js"; import { labelProcess } from "./label-process.native.js"; async function dev(args) { labelProcess("dev"), checkNodeVersion(), setServerGlobals(); var { dev: dev2 } = await import("vxrn/dev"), { start, stop } = await dev2({ mode: args.mode, clean: args.clean, root: process.cwd(), debugBundle: args.debugBundle, debug: args.debug, server: { host: args.host, port: args.port ? +args.port : void 0 }, entries: { native: virtualEntryIdNative } }), { closePromise } = await start(); process.on("beforeExit", function () { stop(); }), process.on("SIGINT", function () { try { stop(); } finally { process.exit(2); } }), process.on("SIGTERM", function () { try { stop(); } finally { process.exit(0); } }), process.on("uncaughtException", function (err) { console.error(err?.message || err); }), process.on("unhandledRejection", function (err) { console.error(err); }), await closePromise; } export { dev }; //# sourceMappingURL=dev.native.js.map