forked from medusajs/admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
46 lines (44 loc) · 1.09 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
37
38
39
40
41
42
43
44
45
46
/// <reference types="vitest" />
import react from "@vitejs/plugin-react"
import dns from "dns"
import path from "path"
import { env } from "process"
import { defineConfig } from "vite"
// 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()],
test: {
environment: "jsdom",
globals: true,
setupFiles: ["./src/test/setup.ts"],
api: 7001,
},
// 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"],
},
})