-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
65 lines (64 loc) · 1.56 KB
/
vite.config.ts
File metadata and controls
65 lines (64 loc) · 1.56 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
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import topLevelAwait from 'vite-plugin-top-level-await'
import wasm from 'vite-plugin-wasm'
import { compression } from 'vite-plugin-compression2'
import inject from '@rollup/plugin-inject'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
topLevelAwait(),
wasm(),
compression(),
inject({
assert: ['assert', 'default']
}),
nodePolyfills()
],
define: {
'process.env.NODE_DEBUG': 'false',
'process.browser': `"test"`,
'process.version': `"test"`
},
resolve: {
alias: {
'@components': '/src/components',
'@common': '/src/common',
'@containers': '/src/containers',
'@pages': '/src/pages',
'@static': '/src/static',
'@store': '/src/store',
'@web3': '/src/web3',
'@utils': '/src/utils',
'@/': '/src'
}
},
server: {
host: 'localhost',
port: 3000
},
build: {
target: 'es2020',
assetsInlineLimit: 0,
chunkSizeWarningLimit: 1000,
rollupOptions: {
external: ['fs/promises', 'path'],
plugins: [inject({ Buffer: ['buffer', 'Buffer'] })],
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
ui: ['@mui/material', '@mui/icons-material', '@emotion/react', '@emotion/styled'],
web3: ['@solana/web3.js'],
utils: ['axios']
}
}
}
},
optimizeDeps: {
esbuildOptions: {
target: 'es2020'
}
}
})