-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvite.config.mjs
48 lines (46 loc) · 1.26 KB
/
vite.config.mjs
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
/// <reference types="vitest" />
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable import/no-extraneous-dependencies */
import path, { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
// eslint-disable-next-line import/no-unresolved
import { configDefaults } from 'vitest/config'
export default defineConfig({
plugins: [react(), dts({ rollupTypes: true })],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(
path.dirname(fileURLToPath(import.meta.url)),
'src/index.tsx',
),
name: 'react-twitch-embed-video',
// the proper extensions will be added
fileName: 'react-twitch-embed-video',
},
rollupOptions: {
external: ['react', 'reactDOM'],
output: {
globals: {
react: 'react',
'react-dom': 'reactDOM',
},
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/test/setup.ts',
coverage: {
exclude: [
...configDefaults.coverage.exclude,
'**/stories/**',
'src/index.tsx',
],
},
},
})