forked from matt8707/ha-fusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
76 lines (74 loc) · 1.76 KB
/
vite.config.ts
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import dotenv from 'dotenv';
dotenv.config();
export default defineConfig({
plugins: [sveltekit()],
build: {
// increase chunk size because of maplibre-gl
chunkSizeWarningLimit: 1000
},
ssr: {
// "cannot use import statement outside a module" because of svelte-ripple
noExternal: ['svelte-ripple']
},
optimizeDeps: {
include: [
// include all because of dynamic imports, prevents: ✨ optimized dependencies changed. reloading
// pnpm ls -P | grep -Ev 'codemirror|@fontsource' | awk '/dependencies:/{flag=1; next} flag{print "\047" $1 "\047,"}'
'@jaames/iro',
'd3-array',
'd3-scale',
'd3-shape',
'dotenv',
'express',
'hls.js',
'home-assistant-js-websocket',
'http-proxy-middleware',
'js-yaml',
'konva',
'maplibre-gl',
'marked',
'svelte-confetti',
'svelte-dnd-action',
'svelte-modals',
'svelte-ripple',
'svelte-tiny-virtual-list',
'weekstart',
// dev deps
'@iconify/svelte',
'svelte-fast-dimension/action',
'@event-calendar/core',
'@event-calendar/day-grid',
'@event-calendar/list'
],
exclude: [
// exclude codemirror to avoid state duplication
// pnpm ls -P | grep codemirror | awk '{print "\047" $1 "\047,"}'
'@codemirror/autocomplete',
'@codemirror/commands',
'@codemirror/language',
'@codemirror/legacy-modes',
'@codemirror/lint',
'@codemirror/state',
'@codemirror/theme-one-dark',
'@codemirror/view',
'codemirror'
]
},
server: {
// required for webrtc
host: true,
// development proxy endpoints
proxy: {
'/local/': {
target: process.env.HASS_URL,
changeOrigin: true
},
'/api/': {
target: process.env.HASS_URL,
changeOrigin: true
}
}
}
});