-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
84 lines (83 loc) · 1.85 KB
/
vite.config.js
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import svgrPlugin from 'vite-plugin-svgr'
import jsconfigPaths from 'vite-jsconfig-paths'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
jsxImportSource: '@emotion/react',
}),
jsconfigPaths({
parseNative: false,
}),
svgrPlugin(),
{
name: 'custom-hmr-control',
handleHotUpdate({ file, server }) {
if (file.includes('src/app/configs/')) {
server.ws.send({
type: 'full-reload',
})
return []
}
return
},
},
],
build: {
outDir: 'build',
},
server: {
open: true,
port: 3000,
},
define: {
global: 'window',
},
resolve: {
alias: {
'@': '/src',
'assets': '/src/assets',
'ui-component':'/src/ui-component',
'layout': '/src/layout',
'menu-items': '/src/menu-items',
'store': '/src/store',
'themes': '/src/themes',
'utils': '/src/utils',
'views': '/src/views',
'@ui': '/src/@ui',
'@core': '/src/@core',
'@history': '/src/@history',
'@lodash': '/src/@lodash',
app: '/src/app',
main: '/src/app/main',
auth: '/src/app/auth',
'app/store': '/src/app/store',
'app/shared-components': '/src/app/shared-components',
'app/configs': '/src/app/configs',
'app/theme-layouts': '/src/app/theme-layouts',
'app/AppContext': '/src/app/AppContext',
},
},
optimizeDeps: {
include: [
'@mui/icons-material',
'@mui/material',
'@mui/base',
'@mui/styles',
'@mui/system',
'@mui/utils',
'@emotion/cache',
'@emotion/react',
'@emotion/styled',
'lodash',
],
exclude: [],
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
})