-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite-dev.config.js
More file actions
36 lines (34 loc) · 879 Bytes
/
vite-dev.config.js
File metadata and controls
36 lines (34 loc) · 879 Bytes
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
27
28
29
30
31
32
33
34
35
36
import {sveltekit} from '@sveltejs/kit/vite'
import {SvelteKitPWA} from '@vite-pwa/sveltekit'
// Having this bit in breaks vite build, but works for vite dev
import {wss} from '@cgreenhalgh/websocket-room-server'
const USE_WEBSOCKETS = true
const webSocketServer = {
name: 'webSocketServer',
configureServer(server) {
if (!server.httpServer) return
if (USE_WEBSOCKETS) {
console.log('(vite) set up websockets')
wss.addWebsockets(server.httpServer)
} else {
console.log(`WARNING: not attempting to set up websockets in dev mode`)
}
}
}
// up to here, and webSocketServer below
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit(), webSocketServer, SvelteKitPWA()],
server: {
port: 3000,
fs: {
allow: [
'/app/uploads/'
]
}
},
optimizeDeps: {
include: ["csv-stringify", "csv-parse"]
}
};
export default config;