-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
41 lines (40 loc) · 978 Bytes
/
vite.config.js
File metadata and controls
41 lines (40 loc) · 978 Bytes
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
// vite.config.js for SVECTOR SDK browser compatibility
import { defineConfig } from 'vite';
export default defineConfig({
build: {
lib: {
entry: 'dist/src/index.js',
name: 'SVECTOR',
fileName: (format) => `svector-sdk.${format}.js`,
formats: ['es', 'umd']
},
rollupOptions: {
external: [],
output: {
globals: {}
}
},
target: 'es2020',
minify: 'terser',
sourcemap: true
},
define: {
// Ensure Node.js globals don't cause issues in browser
global: 'globalThis',
process: 'globalThis.process'
},
optimizeDeps: {
exclude: ['node:stream', 'node:buffer', 'node:crypto']
},
resolve: {
alias: {
// Provide browser-compatible alternatives
'node:stream': 'stream-browserify',
'node:buffer': 'buffer',
'node:crypto': 'crypto-browserify',
'stream': 'stream-browserify',
'buffer': 'buffer',
'crypto': 'crypto-browserify'
}
}
});