-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
35 lines (34 loc) · 882 Bytes
/
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
import react from '@vitejs/plugin-react'
import path from 'path'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [react()],
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'kevlar-tabs',
formats: ['es'],
fileName: (format) => `kevlar-tabs.${format}.js`,
},
sourcemap: true,
rollupOptions: {
external: ['react', 'react/jsx-runtime', 'react/jsx-dev-runtime'],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
react: 'React',
},
},
},
},
test: {
globals: true,
environment: 'happy-dom',
setupFiles: './setupTests.ts',
coverage: {
exclude: ['setupTests.ts', '**/*.test.tsx', '**/*.stories.tsx'],
reporter: ['text', 'json', 'html'],
},
},
})