forked from ssvlabs/ssv-web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
45 lines (44 loc) · 999 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
36
37
38
39
40
41
42
43
44
45
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import path from 'path';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
export default defineConfig(({ mode }) => {
return {
build: {
outDir: 'build',
sourcemap: true,
rollupOptions: {
output: {
sourcemapExcludeSources: true // Ignore sources in node_modules
}
}
},
server: {
port: 3000,
open: true,
},
plugins: [
react(),
nodePolyfills({
globals: {
Buffer: mode === 'production'
}
})
],
define:
mode === 'development'
? {
global: {}
}
: undefined,
resolve: {
alias: {
'~app': path.resolve('./src/app'),
'~lib': path.resolve('./src/lib'),
'~root': path.resolve('./src'),
'~images': path.resolve('./src/images'),
'~redux': path.resolve('./src/redux/*')
}
}
};
});