-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
39 lines (38 loc) Β· 1.05 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
import { defineConfig } from 'vite';
import path from 'path';
import svgr from 'vite-plugin-svgr';
import viteCompression from 'vite-plugin-compression';
import { visualizer } from 'rollup-plugin-visualizer';
export default defineConfig(({ command }) => ({
build: {
rollupOptions: {
// λΈλΌμ°μ μΊμλλ¬Έμ ν΄μκ° μ μ©
output: {
entryFileNames: '[name].[hash].js',
chunkFileNames: '[name].[hash].js',
assetFileNames: '[name].[hash].[ext]'
},
external: [/\.stories\.(t|j)sx?$/, /\.story\.(t|j)sx?$/]
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
esbuild: {
drop: command === 'build' ? ['console', 'debugger'] : []
},
plugins: [
svgr(),
viteCompression({
algorithm: 'gzip',
ext: '.gz'
}),
visualizer({
filename: 'stats.html',
open: true,
gzipSize: true
})
]
}));