forked from gmx-io/gmx-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
65 lines (63 loc) · 1.86 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
54
55
56
57
58
59
60
61
62
63
64
65
/// <reference types="vitest" />
import { defineConfig, type PluginOption } from "vite";
import { visualizer } from "rollup-plugin-visualizer";
import react from "@vitejs/plugin-react";
import path from "path";
import svgr from "vite-plugin-svgr";
import tsconfigPaths from "vite-tsconfig-paths";
import { lingui } from "@lingui/vite-plugin";
export default defineConfig({
worker: {
format: "es",
},
plugins: [
svgr({
include: "**/*.svg?react",
}),
tsconfigPaths(),
react({
babel: {
plugins: ["macros"],
},
}),
lingui(),
visualizer() as PluginOption,
],
resolve: {
alias: {
abis: path.resolve(__dirname, "src/abis"),
App: path.resolve(__dirname, "src/App"),
components: path.resolve(__dirname, "src/components"),
config: path.resolve(__dirname, "src/config"),
context: path.resolve(__dirname, "src/context"),
domain: path.resolve(__dirname, "src/domain"),
fonts: path.resolve(__dirname, "src/fonts"),
img: path.resolve(__dirname, "src/img"),
lib: path.resolve(__dirname, "src/lib"),
ab: path.resolve(__dirname, "src/ab"),
locales: path.resolve(__dirname, "src/locales"),
pages: path.resolve(__dirname, "src/pages"),
styles: path.resolve(__dirname, "src/styles"),
"typechain-types": path.resolve(__dirname, "src/typechain-types"),
prebuilt: path.resolve(__dirname, "src/prebuilt"),
},
},
build: {
assetsInlineLimit: 0,
outDir: "build",
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
vendor: ["ethers", "viem", "date-fns", "recharts", "@rainbow-me/rainbowkit", "lodash"],
},
},
},
},
test: {
environment: "happy-dom",
globalSetup: "./vitest.global-setup.js",
exclude: ["./autotests", "node_modules"],
setupFiles: ["@vitest/web-worker"],
},
});