-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
79 lines (77 loc) · 2.31 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/// <reference types="vitest/config" />
import path from 'path';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import react from '@vitejs/plugin-react';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig, type PluginOption } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
vanillaExtractPlugin(),
visualizer({
filename: './dist/report.html',
gzipSize: true,
brotliSize: true,
}) as PluginOption,
],
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
// unsupported css 추출
// if (
// !id.includes('ApplyHeader') &&
// (id.includes('reset') ||
// id.includes('Callout') ||
// id.includes('Header') ||
// id.includes('Layout') ||
// id.includes('Unsupported'))
// ) {
// return 'unsupported';
// }
if (id.includes('firebase')) return 'firebase';
},
},
},
},
resolve: {
alias: [
{ find: '@apis', replacement: path.resolve(__dirname, 'src/common/apis') },
{
find: '@assets',
replacement: path.resolve(__dirname, 'src/common/assets'),
},
{
find: '@components',
replacement: path.resolve(__dirname, 'src/common/components'),
},
{
find: '@constants',
replacement: path.resolve(__dirname, 'src/common/constants'),
},
{
find: '@hooks',
replacement: path.resolve(__dirname, 'src/common/hooks'),
},
{
find: '@store',
replacement: path.resolve(__dirname, 'src/common/store'),
},
{ find: '@type', replacement: path.resolve(__dirname, 'src/common/type') },
{
find: '@utils',
replacement: path.resolve(__dirname, 'src/common/utils'),
},
{ find: 'contexts', replacement: path.resolve(__dirname, 'src/contexts') },
{ find: 'styles', replacement: path.resolve(__dirname, 'src/styles') },
{ find: 'tests', replacement: path.resolve(__dirname, 'src/tests') },
{ find: 'views', replacement: path.resolve(__dirname, 'src/views') },
],
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/tests/setupTests.ts',
},
});