lasthourcloud/svelte.config.js

38 lines
693 B
JavaScript
Raw Normal View History

import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-node';
2022-02-10 14:47:44 +00:00
2022-05-11 14:15:34 +00:00
import { Server } from 'socket.io';
const webSocketServer = {
name: 'webSocketServer',
configureServer(server) {
const io = new Server(server.httpServer);
io.on('connection', (socket) => {
socket.emit('eventFromServer', 'Hello, World 👋');
});
}
};
2022-02-10 14:47:44 +00:00
const config = {
preprocess: preprocess(),
kit: {
2022-02-10 14:47:44 +00:00
adapter: adapter(),
prerender: {
enabled: false
},
2022-02-10 14:47:44 +00:00
floc: true,
vite: {
2022-05-11 14:15:34 +00:00
plugins: [webSocketServer],
2022-02-10 14:47:44 +00:00
optimizeDeps: {
exclude: ['svelte-kit-cookie-session']
},
server: {
fs: {
allow: ['./src/lib/locales/']
}
}
}
}
};
2022-02-10 14:47:44 +00:00
export default config;