-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
54 lines (54 loc) · 1.74 KB
/
Copy pathvite.config.js
File metadata and controls
54 lines (54 loc) · 1.74 KB
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
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import { defineOpenZeppelinAdapterViteConfig } from '@openzeppelin/adapters-vite';
var viteConfig = defineOpenZeppelinAdapterViteConfig({
ecosystems: ['evm', 'stellar'],
config: {
plugins: [react(), tailwindcss()],
define: {
// Polyfill for Node.js globals used by some wallet dependencies
global: 'globalThis',
},
resolve: {
// Prevent duplicate module instances (causes singleton issues)
dedupe: ['react', 'react-dom', '@openzeppelin/ui-utils', '@openzeppelin/ui-types'],
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
},
// Pre-bundle heavy dependencies upfront for faster page loads
include: [
'react',
'react-dom',
'react-dom/client',
'react/jsx-runtime',
'react/jsx-dev-runtime',
'lucide-react',
'@web3icons/react',
'react-hook-form',
'zustand',
'zustand/shallow',
'sonner',
'next-themes',
'@tanstack/react-query',
'react-syntax-highlighter',
'react-syntax-highlighter/dist/esm/styles/prism',
'viem/chains',
'@rainbow-me/rainbowkit',
],
},
build: {
outDir: 'dist',
sourcemap: true,
target: 'esnext',
},
server: {
port: 3000,
open: true,
},
},
});
export default viteConfig;