-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mjs
62 lines (62 loc) · 1.77 KB
/
vite.config.mjs
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
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',
"@fuse": "/src/@fuse",
"@history": "/src/@history",
"@lodash": "/src/@lodash",
"@mock-api": "/src/@mock-api",
"@schema": "/src/@schema",
"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",
},
},
}
});