-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
61 lines (59 loc) · 1.17 KB
/
vite.config.ts
File metadata and controls
61 lines (59 loc) · 1.17 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
import { defineConfig } from 'vite';
import { fileURLToPath } from 'node:url';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
const libsodiumWrappersCjs = fileURLToPath(
new URL('./node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js', import.meta.url),
);
export default defineConfig({
plugins: [
nodePolyfills({
include: [
'assert',
'buffer',
'crypto',
'events',
'http',
'https',
'os',
'path',
'process',
'stream',
'url',
'util',
'vm',
'zlib',
],
globals: {
Buffer: true,
global: true,
process: true,
},
protocolImports: true,
}),
],
resolve: {
alias: {
'libsodium-wrappers': libsodiumWrappersCjs,
},
},
worker: {
format: 'es',
plugins: () => [],
},
build: {
commonjsOptions: {
transformMixedEsModules: true,
},
},
optimizeDeps: {
include: ['bn.js', 'eventemitter3'],
needsInterop: ['bn.js', 'eventemitter3'],
esbuildOptions: {
target: 'ES2022',
},
},
server: {
port: 3017,
strictPort: true,
},
});