Build stage would stall after finishing, this could cause some issue when containerization is implemented, so I wrote a vite plugin to auto kill it after it finished bundling.
24 lines
600 B
TypeScript
24 lines
600 B
TypeScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
import { startupSocketIOServer } from './src/lib/functions/websocketConfig';
|
|
import closePlugin from './src/lib/functions/autoCloseViteBuild';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
sveltekit(),
|
|
closePlugin(),
|
|
{
|
|
name: 'integratedSocketIOServer',
|
|
configureServer(server) {
|
|
startupSocketIOServer(server.httpServer);
|
|
},
|
|
configurePreviewServer(server) {
|
|
startupSocketIOServer(server.httpServer);
|
|
},
|
|
},
|
|
],
|
|
server: {
|
|
allowedHosts: true,
|
|
},
|
|
});
|