-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.js
26 lines (22 loc) · 778 Bytes
/
dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { createServer } = require('vite');
async function bootstrap() {
const viteServer = await createServer({
server: { middlewareMode: true },
});
// const { createApp } = await viteServer.ssrLoadModule('./src/main.ts');
// let app = await createApp;
// app.use(viteServer.middlewares);
// await app.listen(3000);
// viteServer.watcher.on('change', async () => {
// viteServer.config.logger.info('on change');
// setTimeout(async () => {
// viteServer.config.logger.info('restarting server');
// // await app.close();
// const { createApp } = await viteServer.ssrLoadModule('./src/main.ts');
// app = await createApp;
// // await app.listen(3000);
// await app.init();
// }, 2000);
// });
}
bootstrap();