forked from raisch/ligerbots-website-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
33 lines (28 loc) · 953 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
import dotenv from 'dotenv'
dotenv.config({ path: `.env` })
dotenv.config({ path: `.env.${process.env.NODE_ENV}` })
dotenv.config({ path: `.env.local` })
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
const SERVER_PORT = parseInt(process.env.PUBLIC_SERVER_PORT || '4000')
const SERVER_HOST = process.env.PUBLIC_SERVER_HOST
const API_URL = process.env.API_URL
const SERVER_ORIGIN = `http://${SERVER_HOST}:${SERVER_PORT}`;
export default defineConfig({
cacheDir: './cache',
server: {
host: true,
port: SERVER_PORT,
origin: SERVER_ORIGIN,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With',
'Access-Control-Allow-Credentials': 'true',
'Access-Control-Max-Age': '1728000',
}
},
plugins: [
sveltekit()
]
});