-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.ts
38 lines (36 loc) · 976 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
const isLocal = process.env.VITE_ENV === 'local';
export default defineConfig(() => {
return {
define: {
'process.env': {},
},
build: {
outDir: 'build',
assetsInlineLimit: 0,
sourcemap: true,
},
base: isLocal ? '' : process.env.PUBLIC_URL,
plugins: [
react(),
// fetch-mock calls global 'process' which is not available
// in the browser, so mock this.
nodePolyfills({
globals: {
process: true,
},
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3006,
},
};
});