-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
44 lines (41 loc) · 1.42 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
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile"
// https://vitejs.dev/config/
export default ({ mode }) => {
Object.assign(process.env, loadEnv(mode, process.cwd()));
return defineConfig({
plugins: [react(), viteSingleFile()],
define: {
"process.env": {
NX_RIVET_KEY: process.env.VITE_RIVET_KEY,
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_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,
NODE_ENV: "16.6.0",
},
},
optimizeDeps: {
esbuildOptions: {
target: "es2020",
define: {
global: "globalThis",
},
supported: {
bigint: true,
},
},
},
build: {
target: ["es2020"],
},
});
};