-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
46 lines (44 loc) · 986 Bytes
/
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
46
import basicSsl from '@vitejs/plugin-basic-ssl';
import react from '@vitejs/plugin-react';
import { defineConfig, UserConfig } from 'vite';
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';
import svgr from 'vite-plugin-svgr';
export const port = 5173;
export default defineConfig(
(configEnv): UserConfig => ({
base: '/',
publicDir: './public',
build: {
outDir: './build',
},
server: {
port,
strictPort: true,
},
plugins: [
react(),
basicSsl(),
chunkSplitPlugin({
strategy: 'all-in-one',
customSplitting: {
app: [/src\//],
vendors: [/node_modules\//],
},
}),
svgr(),
],
css: {
modules: {
generateScopedName:
configEnv.mode === 'development'
? '[local]-[hash:base64:5]'
: '[hash:base64:5]',
},
},
resolve: {
alias: {
'~/': `${__dirname}/src/`,
},
},
})
);