-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
55 lines (53 loc) · 1.14 KB
/
vite.config.js
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
export default defineConfig({
plugins: [react()],
base: '/',
define: {
global: 'globalThis',
'process.env': {},
'process.platform': JSON.stringify('browser'),
'process.version': JSON.stringify('v16.0.0'),
'process.browser': true,
},
build: {
outDir: 'dist',
assetsDir: 'assets',
rollupOptions: {
output: {
manualChunks: undefined,
},
},
commonjsOptions: {
esmExternals: true,
}
},
resolve: {
alias: {
stream: 'stream-browserify',
buffer: 'buffer',
util: 'util',
process: 'process/browser',
path: 'path-browserify',
url: 'url',
http: 'http-browserify',
https: 'https-browserify',
crypto: 'crypto-browserify',
os: 'os-browserify/browser',
assert: 'assert',
constants: 'constants-browserify',
fs: false,
net: false,
tls: false,
child_process: false,
}
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis'
}
}
}
});