-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.ts
45 lines (43 loc) ยท 1.58 KB
/
vite.config.ts
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: [
{ find: '@', replacement: path.resolve(__dirname, 'src') },
{ find: '@/Api', replacement: path.resolve(__dirname, 'Api') },
{ find: '@/Assets', replacement: path.resolve(__dirname, 'Assets') },
{
find: '@/Components',
replacement: path.resolve(__dirname, 'Components'),
},
{
find: '@/Constants',
replacement: path.resolve(__dirname, 'Constants'),
},
{ find: '@/Contexts', replacement: path.resolve(__dirname, 'Contexts') },
{ find: '@/Hooks', replacement: path.resolve(__dirname, 'Hooks') },
{ find: '@/Pages', replacement: path.resolve(__dirname, 'Pages') },
{ find: '@/Routes', replacement: path.resolve(__dirname, 'Routes') },
{ find: '@/Services', replacement: path.resolve(__dirname, 'Services') },
{ find: '@/Stores', replacement: path.resolve(__dirname, 'Stores') },
{ find: '@/Styles', replacement: path.resolve(__dirname, 'Styles') },
{ find: '@/Types', replacement: path.resolve(__dirname, 'Types') },
{ find: '@/Utils', replacement: path.resolve(__dirname, 'Utils') },
],
},
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
const module = id.split('node_modules/').pop().split('/')[0];
return `vendor/${module}`;
}
},
},
},
},
});