-
Notifications
You must be signed in to change notification settings - Fork 63
/
vite.config.ts
84 lines (83 loc) · 2.37 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
80
81
82
83
84
/// <reference types="vitest" />
import path from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import unfonts from 'unplugin-fonts/vite'
import checker from 'vite-plugin-checker'
import eslint from 'vite-plugin-eslint'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
...(mode !== 'test' && {
plugins: [
react(),
eslint(),
checker({ typescript: true }),
unfonts({
google: {
families: [
{ name: 'Titillium+Web', styles: 'wght@700' },
{ name: 'Source+Serif+Pro', styles: 'wght@400;700' },
{ name: 'Merriweather+Sans', styles: 'wght@400;700' },
{
name: 'Source+Sans+Pro',
styles:
'ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700',
},
],
},
}),
],
}),
test: {
environment: 'jsdom',
setupFiles: 'src/shared/lib/test/setup.ts',
coverage: {
provider: 'v8',
exclude: ['src/shared/api/realworld/**'],
},
},
server: { host: false },
preview: { open: true },
build: {
rollupOptions: {
output: {
manualChunks: {
'article-service': [
'src/shared/api/article/article.service.ts',
'src/shared/api/article/index.ts',
],
'auth-service': [
'src/shared/api/auth/auth.service.ts',
'src/shared/api/auth/index.ts',
],
'comment-service': [
'src/shared/api/comment/comment.service.ts',
'src/shared/api/comment/index.ts',
],
'favorite-service': [
'src/shared/api/favorite/favorite.service.ts',
'src/shared/api/favorite/index.ts',
],
'profile-service': [
'src/shared/api/profile/profile.service.ts',
'src/shared/api/profile/index.ts',
],
'tag-service': [
'src/shared/api/tag/tag.service.ts',
'src/shared/api/tag/index.ts',
],
},
},
},
},
resolve: {
alias: {
'~app': path.resolve('src/app'),
'~entities': path.resolve('src/entities'),
'~features': path.resolve('src/features'),
'~pages': path.resolve('src/pages'),
'~shared': path.resolve('src/shared'),
'~widgets': path.resolve('src/widgets'),
},
},
}))