-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.ts
53 lines (51 loc) · 1.99 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
47
48
49
50
51
52
53
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default ({ mode }) => {
Object.assign(process.env, loadEnv(mode, process.cwd()));
return defineConfig({
plugins: [react()],
define: {
"process.env": {
NX_RIVET_KEY: process.env.VITE_RIVET_KEY,
NX_MAINNET_RPC: process.env.VITE_MAINNET_RPC,
NX_GOERLI_RPC: process.env.VITE_GOERLI_RPC,
NX_GNOSISCHAIN_RPC: process.env.VITE_GNOSISCHAIN_RPC,
NX_OPTIMISM_RPC: process.env.VITE_OPTIMISM_RPC,
NX_POLYGONPOS_RPC: process.env.VITE_POLYGONPOS_RPC,
NX_ARBITRUM_RPC: process.env.VITE_ARBITRUM_RPC,
NX_SEPOLIA_RPC: process.env.VITE_SEPOLIA_RPC,
NX_BASE_RPC: process.env.VITE_BASE_RPC,
NX_GRAPH_API_KEY_MAINNET: process.env.VITE_GRAPH_API_KEY_MAINNET,
NX_INFURA_PROJECT_ID: process.env.VITE_INFURA_PROJECT_ID,
NX_ETHERSCAN_KEY: process.env.VITE_ETHERSCAN_KEY,
NX_ARBISCAN_KEY: process.env.VITE_ARBISCAN_KEY,
NX_GNOSISSCAN_KEY: process.env.VITE_GNOSISSCAN_KEY,
NX_POLYGONSCAN_KEY: process.env.VITE_POLYGONSCAN_KEY,
NX_OPTIMISMSCAN_KEY: process.env.VITE_OPTIMISMSCAN_KEY,
NX_SEPOLIASCAN_KEY: process.env.VITE_SEPOLIASCAN_KEY,
NX_BASESCAN_KEY: process.env.VITE_BASESCAN_KEY,
NX_WALLET_CONNECT_ID: process.env.VITE_WALLET_CONNECT_ID,
NX_OPTIMISM_ALCHEMY_KEY: process.env.VITE_OPTIMISM_ALCHEMY_KEY,
NX_ARBITRUM_ALCHEMY_KEY: process.env.VITE_ARBITRUM_ALCHEMY_KEY,
NX_POLYGONPOS_ALCHEMY_KEY: process.env.VITE_POLYGONPOS_ALCHEMY_KEY,
NX_SEPOLIA_ALCHEMY_KEY: process.env.VITE_SEPOLIA_ALCHEMY_KEY,
NX_BASE_ALCHEMY_KEY: process.env.VITE_BASE_ALCHEMY_KEY,
},
},
optimizeDeps: {
esbuildOptions: {
target: "es2020",
define: {
global: "globalThis",
},
supported: {
bigint: true,
},
},
},
build: {
target: ["es2020"],
},
});
};