Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
55 lines (54 loc) · 1.47 KB
/
Copy pathvite.config.ts
File metadata and controls
55 lines (54 loc) · 1.47 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
import react from '@vitejs/plugin-react'
import path from 'path'
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 1234,
host: true
},
build: {
outDir: 'build',
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
mui: ['@mui/material', '@mui/icons-material', '@mui/lab'],
reactAdmin: ['react-admin']
}
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'components': path.resolve(__dirname, './src/components'),
'config': path.resolve(__dirname, './src/config'),
'context': path.resolve(__dirname, './src/context'),
'hooks': path.resolve(__dirname, './src/hooks'),
'types': path.resolve(__dirname, './src/types'),
'utilities': path.resolve(__dirname, './src/utilities'),
'utils': path.resolve(__dirname, './src/utils.tsx'),
'roundwareDataProvider': path.resolve(__dirname, './src/roundwareDataProvider')
}
},
define: {
// Ensure process.env is available for compatibility
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
},
optimizeDeps: {
include: [
'react',
'react-dom',
'react-admin',
'@mui/material',
'@mui/icons-material',
'@mui/lab',
'@mui/x-date-pickers',
'react-router-dom',
'react-query'
]
}
})