-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
43 lines (42 loc) · 1.21 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
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import viteTsconfigPaths from 'vite-tsconfig-paths' // https://vitejs.dev/config/
// https://vitejs.dev/config/
export default defineConfig({
build: {
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
jotai: ['jotai'],
react: ['react', 'react-dom'],
reactHotToast: ['react-hot-toast'],
reactRouter: ['react-router', 'react-router-dom'],
solanaWeb3: ['@solana/web3.js'],
solanaWalletAdapters: [
'@solana/wallet-adapter-base',
'@solana/wallet-adapter-react',
'@solana/wallet-adapter-react-ui',
],
tabler: ['@tabler/icons-react'],
tanstack: ['@tanstack/react-query'],
},
},
},
},
define: {
global: 'globalThis',
},
optimizeDeps: {
esbuildOptions: {
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
}),
],
},
},
plugins: [viteTsconfigPaths(), react(), nodePolyfills()],
})