forked from medusajs/admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
39 lines (37 loc) · 970 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
import path from "path"
import { env } from "process"
import dns from "dns"
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
// Resolve localhost for Node v16 and older.
// @see https://vitejs.dev/config/server-options.html#server-host.
dns.setDefaultResultOrder("verbatim")
export default defineConfig({
plugins: [react()],
// Backwards-compat with Gatsby.
publicDir: "static",
build: {
outDir: "public",
},
resolve: {
alias: {
gatsby: path.resolve(__dirname, "src/compat/gatsby-compat.tsx"),
"@reach/router": path.resolve(
__dirname,
"src/compat/reach-router-compat.tsx"
),
},
},
define: {
__MEDUSA_BACKEND_URL__: JSON.stringify(
env.MEDUSA_BACKEND_URL ||
// Backwards-compat with Gatsby.
env.GATSBY_MEDUSA_BACKEND_URL ||
env.GATSBY_STORE_URL ||
""
),
},
optimizeDeps: {
exclude: ["typeorm", "medusa-interfaces"],
},
})