-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.mts
53 lines (52 loc) · 1.29 KB
/
vite.config.mts
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
/// <reference types="vitest" />
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { defineConfig } from 'vite';
// adds typecheck directly in the dev server in browser
// https://github.com/fi3ework/vite-plugin-checker
import checker from 'vite-plugin-checker';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
import dts from 'vite-plugin-dts';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
cssInjectedByJsPlugin(),
dts({
include: ['src/lib/'],
}),
checker({
typescript: true,
}),
],
server: {
open: true, // automatically open app in browser on server start
port: 4000, // change port number
},
build: {
lib: {
entry: resolve(__dirname, 'src/lib/index.ts'),
name: 'React Timeline Responsive',
formats: ['es', 'umd'],
fileName: (format) => `react-timeline-responsive.${format}.js`,
},
rollupOptions: {
external: ['react'],
output: {
globals: {
react: 'React',
},
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: 'tests/setupTests.ts',
coverage: {
provider: 'v8',
reporter: ['text', 'json'],
reportsDirectory: 'coverage',
},
},
});