-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
35 lines (31 loc) · 936 Bytes
/
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
import path from 'path';
import { fileURLToPath } from 'url';
import svgr from '@svgr/rollup';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import stdLibBrowser from 'vite-plugin-node-stdlib-browser';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default defineConfig({
plugins: [react(), stdLibBrowser(), svgr()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
global: path.resolve(__dirname, 'node_modules/global'),
buffer: path.resolve(__dirname, 'node_modules/buffer'),
crypto: path.resolve(__dirname, 'node_modules/crypto-browserify'),
stream: path.resolve(__dirname, 'node_modules/stream-browserify'),
},
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
plugins: [],
},
},
define: {
'process.env': {},
},
});