-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
56 lines (55 loc) · 1.29 KB
/
vite.config.ts
File metadata and controls
56 lines (55 loc) · 1.29 KB
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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
export default defineConfig({
base: "/miden-arena/",
plugins: [react()],
resolve: {
alias: {
// Deduplicate: force the symlinked react-sdk to use the app's
// single copy of miden-sdk so WASM class identity checks pass.
"@miden-sdk/miden-sdk": path.resolve(
__dirname,
"node_modules/@miden-sdk/miden-sdk"
),
},
dedupe: ["@miden-sdk/miden-sdk"],
preserveSymlinks: true,
},
server: {
fs: {
allow: [
// Project root
".",
// Local react-sdk symlink target
"../miden-client",
],
},
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
proxy: {
// gRPC-web requests from the WASM client go to /rpc.Api/* on same origin.
// Proxy them to the real Miden testnet RPC to avoid CORS issues.
"/rpc.Api": {
target: "https://rpc.testnet.miden.io",
changeOrigin: true,
},
},
},
build: {
target: "esnext",
},
worker: {
format: "es",
rollupOptions: {
output: {
format: "es",
},
},
},
optimizeDeps: {
exclude: ["@miden-sdk/miden-sdk"],
},
});