Wondering if it’s possible to run a Vite server within another.
I’m trying to create a plugin that serves assets of another library in a monorepo. I can’t seem to get both running at the same time.
import { createServer } from 'vite';
const CONFIG_FILE = "...";
export default function viteMyServer() {
return {
name: 'vite-plugin-my-server',
async configureServer(server) {
const viteService = await createServer({
configFile: CONFIG_FILE,
appType: "custom",
server: {
middlewareMode: true,
},
});
server.middlewares.use(viteService.middlewares.handle);
}
}
}