-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
48 lines (46 loc) · 1.28 KB
/
vite.config.ts
File metadata and controls
48 lines (46 loc) · 1.28 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
import process from 'node:process';
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import {visualizer} from 'rollup-plugin-visualizer';
import {defineConfig} from 'vite';
const baseUrl = process.env['VITE_BASE_URL'];
const enableVisualizer = process.env['VITE_ENABLE_VISUALIZER'];
export default defineConfig({
base: baseUrl ? `/${baseUrl}` : undefined,
plugins: [
react({
babel: {
plugins: ['babel-plugin-react-compiler'],
},
}),
tailwindcss(),
enableVisualizer ? visualizer() : undefined,
].filter(Boolean),
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('rc-field-form')) return 'rc-field-form';
return undefined;
},
},
},
},
resolve: {
alias: {
'@tabler/icons-react': '@tabler/icons-react/dist/esm/icons/index.mjs',
/* eslint-disable @typescript-eslint/naming-convention */
'#atom': '/src/atom.ts',
'#data': '/src/data/index.ts',
'#components': '/src/components',
'#constants': '/src/constants.ts',
'#context': '/src/context.tsx',
'#hooks': '/src/hooks.ts',
'#i18n': '/src/i18n/_index.i18n.ts',
'#types': '/src/types.ts',
'#utils': '/src/utils.ts',
'#vendor': '/src/vendor',
/* eslint-enable @typescript-eslint/naming-convention */
},
},
});