-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
83 lines (80 loc) · 4.04 KB
/
vite.config.ts
File metadata and controls
83 lines (80 loc) · 4.04 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* ═══════════════════════════════════════════════════════════════════════════
* BNB CHAIN AI TOOLKIT - Vite Configuration
* ═══════════════════════════════════════════════════════════════════════════
* ✨ Author: nich | 🐦 x.com/nichxbt | 🐙 github.com/nirholas
* 📦 github.com/nirholas/bnb-chain-toolkit | 🌐 https://bnb-chain-toolkit.vercel.app
* Copyright (c) 2024-2026 nirholas (nich) - MIT License
* @preserve
* ═══════════════════════════════════════════════════════════════════════════
*/
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// Banner injected into all built JS files - nich | x.com/nichxbt | github.com/nirholas
const banner = `/**
* ═══════════════════════════════════════════════════════════════════════════
* BNB CHAIN AI TOOLKIT - https://bnb-chain-toolkit.vercel.app
* ═══════════════════════════════════════════════════════════════════════════
* ✨ Author: nich | 🐦 x.com/nichxbt | 🐙 github.com/nirholas
* 📦 github.com/nirholas/bnb-chain-toolkit
* Copyright (c) 2024-${new Date().getFullYear()} nirholas (nich) - MIT License
*
* NOTICE: This code contains embedded watermarks and attribution markers.
* Removal or modification of attribution constitutes violation of the license.
* ═══════════════════════════════════════════════════════════════════════════
* @author nich (@nichxbt)
* @repository https://github.com/nirholas/bnb-chain-toolkit
* @preserve
*/`;
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: '/',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3000,
host: true,
open: true,
headers: {
'Content-Security-Policy': "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://unpkg.com https://cdn.tailwindcss.com https://esm.sh https://binaries.soliditylang.org; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https: ws: wss:; worker-src 'self' blob:; frame-src 'self' blob:; frame-ancestors 'self'; manifest-src 'self'",
},
},
build: {
outDir: 'dist',
sourcemap: true,
target: 'esnext',
chunkSizeWarningLimit: 600,
rollupOptions: {
onwarn(warning, warn) {
// Suppress /*#__PURE__*/ annotation warnings from third-party packages
if (warning.code === 'SOURCEMAP_ERROR' || warning.message?.includes('/*#__PURE__*/')) return
warn(warning)
},
output: {
banner,
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
'motion': ['framer-motion'],
'web3-vendor': ['ethers', 'viem'],
'solana': ['@solana/web3.js'],
'privy': ['@privy-io/react-auth'],
'ui-vendor': ['lucide-react', '@icons-pack/react-simple-icons', 'clsx', 'tailwind-merge'],
'monaco': ['@monaco-editor/react', 'monaco-editor'],
},
},
},
},
optimizeDeps: {
exclude: ['@solana/web3.js'],
entries: [
'index.html',
'public/erc8004.html',
'src/**/*.{ts,tsx}',
],
},
})