-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
74 lines (68 loc) · 1.8 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
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
import { defineConfig } from "vite"
// import EnvironmentPlugin from "vite-plugin-environment";
import react from "@vitejs/plugin-react";
import path from "path";
import "dotenv/config";
export default ({ mode }) => {
return defineConfig({
plugins: [react()],
base: "/music-player/",
define: {
"process.env": {
"AUTH_BASE_URL": process.env.AUTH_BASE_URL,
"API_BASE_URL": process.env.API_BASE_URL,
"CLIENT_ID": process.env.CLIENT_ID,
"CLIENT_SECRET": process.env.CLIENT_SECRET,
"SITE_DOMAIN": mode === "development" ? process.env.SITE_DOMAIN_DEV : process.env.SITE_DOMAIN_PROD
}
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src")
}
},
})
}
// https://vitejs.dev/config/
// export default defineConfig({
// plugins: [react(), EnvironmentPlugin({
// "AUTH_BASE_URL": process.env.AUTH_BASE_URL,
// "API_BASE_URL": process.env.API_BASE_URL,
// "CLIENT_ID": process.env.CLIENT_ID,
// "CLIENT_SECRET": process.env.CLIENT_SECRET,
// "SITE_DOMAIN": process.env.SITE_DOMAIN
// })],
// base: "/music-player/",
// define: {
// 'process.env': {}
// },
// resolve: {
// alias: {
// '@': path.resolve(__dirname, './src')
// }
// },
// })
// export default defineConfig(({ mode }) => {
// const env = loadEnv(mode, process.cwd())
// const processEnvValues = {
// 'process.env': Object.entries(env).reduce(
// (prev, [key, val]) => {
// return {
// ...prev,
// [key]: val,
// }
// },
// {},
// )
// }
// return {
// plugins: [react()],
// base: "/music-player/",
// define: processEnvValues,
// resolve: {
// alias: {
// '@': path.resolve(__dirname, './src')
// }
// },
// }
// })