30 lines
647 B
JavaScript
30 lines
647 B
JavaScript
|
|
import {
|
||
|
|
resolveViteConfigs
|
||
|
|
} from "./chunk-7E4FQJTV.js";
|
||
|
|
|
||
|
|
// node/commands/serve.ts
|
||
|
|
import { join } from "node:path";
|
||
|
|
import process from "node:process";
|
||
|
|
import { createServer as createViteServer } from "vite";
|
||
|
|
async function createServer(options, viteConfig = {}, serverOptions) {
|
||
|
|
process.env.EDITOR = process.env.EDITOR || "code";
|
||
|
|
const inlineConfig = await resolveViteConfigs(
|
||
|
|
options,
|
||
|
|
{
|
||
|
|
optimizeDeps: {
|
||
|
|
entries: [
|
||
|
|
join(options.clientRoot, "main.ts")
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
viteConfig,
|
||
|
|
"serve",
|
||
|
|
serverOptions
|
||
|
|
);
|
||
|
|
return await createViteServer(inlineConfig);
|
||
|
|
}
|
||
|
|
|
||
|
|
export {
|
||
|
|
createServer
|
||
|
|
};
|