-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
66 lines (66 loc) · 1.78 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
import { defineConfig } from 'vite';
import { visualizer } from 'rollup-plugin-visualizer';
import react from '@vitejs/plugin-react-swc';
import vitePluginSvgr from 'vite-plugin-svgr';
import svgr from '@svgr/rollup';
import macrosPlugin from 'vite-plugin-babel-macros';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
vitePluginSvgr(),
svgr({ dimensions: false, svgo: false, typescript: true }),
macrosPlugin(),
visualizer()
],
define: {
'process.env': process.env
},
server: {
port: 3000
},
resolve: {
alias: {
'@assets': '/src/assets',
'@components': '/src/components',
'@constants': '/src/constants',
'@contexts': '/src/contexts',
'@data': '/src/data',
'@db': '/src/db',
'@dtos': '/src/dtos',
'@fonts': '/src/fonts',
'@hooks': '/src/hooks',
'@i18n': '/src/i18n',
'@interfaces': '/src/interfaces',
'@layouts': '/src/layouts',
'@pages': '/src/pages',
'@redux': '/src/redux',
'@styles': '/src/styles',
'@translate': '/src/translate',
'@type': '/src/type',
'@ui': '/src/ui',
'@utils': '/src/utils',
'@widgets': '/src/widgets'
}
},
optimizeDeps: {
exclude: ['js-big-decimal']
},
css: {
preprocessorOptions: {
scss: {
api: 'modern',
quietDeps: true
}
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom']
}
}
}
}
});