-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
86 lines (84 loc) · 2.38 KB
/
Copy pathvite.config.ts
File metadata and controls
86 lines (84 loc) · 2.38 KB
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
85
86
/// <reference types="vitest/config" />
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
import path from 'path'
import { fileURLToPath } from 'node:url'
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'
import { playwright } from '@vitest/browser-playwright'
const dirname = path.dirname(fileURLToPath(import.meta.url))
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), svgr()],
resolve: {
alias: {
'@': path.resolve(dirname, './src'),
},
},
server: {
host: '127.0.0.1',
proxy: {
// VITE_API_URL이 설정된 경우 axios가 직접 요청하므로 이 프록시는 사용되지 않음
// 로컬 백엔드 서버를 직접 띄울 때만 활성화됨
'/api': {
target:
process.env.VITE_API_URL?.replace('/api', '') ||
'https://dev-api.alter-app.com',
changeOrigin: true,
secure: true,
},
},
},
test: {
// 브라우저 커버리지: 리맵 후 exclude를 다시 적용해 CSS·정적 자산·Storybook preview 등을 리포트에서 제외
coverage: {
provider: 'v8',
excludeAfterRemap: true,
include: ['src/**/*.{ts,tsx}'],
exclude: [
'coverage/**',
'src/**/*.stories.{ts,tsx}',
'src/**/*.mdx',
'src/**/*.d.ts',
'src/assets/**',
'src/app/styles/**',
'src/**/types/**',
'storybook/**',
'**/*.{css,png,jpg,jpeg,gif,webp,svg,ico}',
],
},
projects: [
{
extends: true,
test: {
name: 'unit',
environment: 'node',
include: ['src/**/*.test.{ts,tsx}'],
},
},
{
extends: true,
plugins: [
// The plugin will run tests for the stories defined in your Storybook config
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
storybookTest({
configDir: path.join(dirname, 'storybook'),
}),
],
test: {
name: 'storybook',
browser: {
enabled: true,
headless: true,
provider: playwright({}),
instances: [
{
browser: 'chromium',
},
],
},
},
},
],
},
})