-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
66 lines (65 loc) · 1.64 KB
/
vite.config.ts
File metadata and controls
66 lines (65 loc) · 1.64 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { crx } from '@crxjs/vite-plugin'
import { resolve } from 'path'
import manifest from './manifest.json'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), crx({ manifest })],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'@shared': resolve(__dirname, 'src/shared'),
},
},
build: {
rollupOptions: {
input: {
popup: resolve(__dirname, 'src/popup/index.html'),
editor: resolve(__dirname, 'src/editor/index.html'),
codegen: resolve(__dirname, 'src/codegen/index.html'),
options: resolve(__dirname, 'src/options/index.html'),
},
},
sourcemap: process.env.NODE_ENV === 'development' ? 'inline' : false,
},
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173,
},
},
// Vitest 配置
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
include: ['src/**/__tests__/**/*.test.{ts,tsx}'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: [
'src/editor/**/*.ts',
'src/editor/**/*.tsx',
'src/background/**/*.ts',
'src/content/**/*.ts',
'src/codegen/**/*.ts',
'src/shared/stores/**/*.ts',
'src/shared/components/ui/**/*.tsx',
],
exclude: [
'src/**/*.d.ts',
'src/**/__tests__/**',
'src/**/index.ts',
],
thresholds: {
lines: 60,
functions: 60,
branches: 60,
statements: 60,
},
},
},
})