-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
72 lines (69 loc) · 1.69 KB
/
vite.config.ts
File metadata and controls
72 lines (69 loc) · 1.69 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
/// <reference types="vitest/config" />
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
export default defineConfig({
plugins: [
react(),
dts({
insertTypesEntry: true,
rollupTypes: true,
tsconfigPath: './tsconfig.json',
entryRoot: 'lib',
outDir: 'dist'
})
],
build: {
copyPublicDir: false,
lib: {
entry: path.resolve(__dirname, 'lib/index.ts'),
name: 'DualScrollSync',
formats: ['es', 'cjs'],
fileName: (format) => `index.${format === 'es' ? 'js' : 'cjs'}`
},
rollupOptions: {
external: ['react', 'react-dom', 'clsx', 'styled-components'],
output: { exports: 'named' }
}
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./lib/setupTests.ts'],
include: ['lib/**/*.{test,spec}.{js,ts,jsx,tsx}'],
coverage: {
all: true,
thresholds: { functions: 80, branches: 80, lines: 80, statements: 80 },
include: ['lib/**/*.{js,jsx,ts,tsx}'],
exclude: [
'**/stories/**',
'**/storybook-static/**',
'**/dist/**',
'**/node_modules/**',
'**/*.d.ts',
'**/*.config.*',
'**/vite.config.*',
'**/.storybook/**',
'**/lib/**/index.{js,ts,jsx,tsx}',
'**/lib/**/*.types.{js,ts,jsx,tsx}'
],
provider: 'v8',
reporter: ['html', 'text', 'text-summary', 'lcov']
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./lib', import.meta.url))
}
},
css: {
preprocessorOptions: {
scss: {
loadPaths: [fileURLToPath(new URL('./lib', import.meta.url))]
}
}
}
});