-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
36 lines (34 loc) · 1.27 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import EnvironmentPlugin from 'vite-plugin-environment'
import env from 'dotenv'
env.config()
const port = process.env.PORT ? Number(process.env.PORT) : 8080
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
EnvironmentPlugin({
ENV: process.env.NODE_ENV,
DISABLE_CACHE: process.env.DISABLE_CACHE === 'true' ? 'true' : 'false',
ORIGIN: process.env.ORIGIN ?? 'http://localhost',
ORIGIN_PORT: process.env.ORIGIN_PORT ?? port.toString(),
PORT: port.toString(),
GRAPH_URL: process.env.GRAPH_URL ?? 'http://localhost',
GRAPH_PORT: process.env.GRAPH_PORT ?? '8100',
GRAPH_PATH: process.env.GRAPH_PATH ?? 'graphql',
STUDIO_URL: process.env.STUDIO_URL ?? 'http://localhost:5555',
AUTH0_DOMAIN: process.env.AUTH0_DOMAIN ?? null,
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE ?? null,
AUTH0_CID: process.env.AUTH0_CID ?? null,
AUTH0_S: process.env.AUTH0_S ?? null,
}),
],
server: {
port: process.env.ORIGIN_PORT ? Number(process.env.ORIGIN_PORT) : port,
// host: process.env.ORIGIN_HOST ?? 'localhost',
},
preview: {
port: process.env.ORIGIN_PORT ? Number(process.env.ORIGIN_PORT) : port,
},
})