-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
45 lines (42 loc) · 1.17 KB
/
vite.config.js
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
import { sveltekit } from '@sveltejs/kit/vite';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(
fileURLToPath(
import.meta.url)
); // jshint ignore:line
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],
server: {
fs: {
// throws an error without this when importing Fira font
allow: ['..']
},
proxy: {},
port: 5174,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET,OPTIONS,PATCH,DELETE,POST,PUT',
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
}
},
optimizeDeps: {
include: ["svelte/internal"],
exclude: ["svelte/animate"],
},
resolve: {
alias: {
"@": resolve("src"),
"$styles": resolve("src/styles"),
"$stores": resolve("src/lib/stores"),
"$utils": resolve("src/lib/utils"),
"$components": resolve("src/lib/components"),
"$cshared": resolve("src/lib/components/shared"),
},
},
define: {
'__SERVER_VERSION__': JSON.stringify(process.env.npm_package_version),
}
};
export default config;