-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathvite.config.js
64 lines (62 loc) · 1.52 KB
/
vite.config.js
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
57
58
59
60
61
62
63
64
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import svgr from "vite-plugin-svgr";
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
import rollupNodePolyFill from "rollup-plugin-node-polyfills";
import eslint from "vite-plugin-eslint";
import EnvironmentPlugin from "vite-plugin-environment";
import { visualizer } from "rollup-plugin-visualizer";
export default defineConfig({
build: {
outDir: "build",
commonjsOptions: {
include: [],
},
rollupOptions: {
maxParallelFileOps: 100,
plugins: [rollupNodePolyFill()],
commonjsOptions: {
transformMixedEsModules: true,
},
},
},
plugins: [
react(),
svgr(),
tsconfigPaths(),
eslint({
exclude: ["**/node_modules/**", "**/sdk/**"],
failOnError: false,
}),
EnvironmentPlugin("all", { prefix: "REACT_APP_" }),
visualizer({
template: "raw-data",
open: false,
gzipSize: true,
brotliSize: true,
filename: "bundle-size-analysis.json",
}),
],
optimizeDeps: {
disabled: false,
include: [
"@web3-onboard/common",
"@walletconnect/ethereum-provider",
"rxjs",
"rxjs/operators",
"@across-protocol/contracts",
],
esbuildOptions: {
define: {
global: "globalThis",
},
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
],
},
},
});