-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
vite.config.ts
49 lines (45 loc) · 875 Bytes
/
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
import { sveltekit } from '@sveltejs/kit/vite';
import { PluginOption } from "vite";
export function customHmr() {
return {
name: 'custom-hmr',
enforce: 'post',
// HMR
handleHotUpdate({ file, server }) {
if (file.endsWith('.css')) {
console.log('reloading css file...');
server.ws.send({
type: 'full-reload',
path: '*'
});
}
},
}
}
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit(), customHmr(),],
server: {
fs: {
allow: ["./modules/", "./admin/", '../..']
},
port: 3000,
},
resolve: {
alias: {
$components: "/src/components/",
$lib: "/src/lib/",
$routes: "/src/routes/",
},
},
optimizeDeps: {
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
},
rollupInputOptions: {
external: ['@resvg/resvg-js-win32-x64-msvc'],
},
ssr: {
noExternal: ['three']
}
};
export default config;