forked from petyosi/react-virtuoso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
30 lines (28 loc) · 788 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import dts from 'vite-plugin-dts'
const ext = {
cjs: 'cjs',
es: 'mjs',
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react({ jsxRuntime: 'classic' }), dts({ rollupTypes: true })],
build: {
target: ['es2020', 'edge88', 'firefox78', 'chrome79', 'safari14'],
minify: 'terser',
lib: {
entry: ['src/index.tsx'],
formats: ['es', 'cjs'],
fileName: (format) => `index.${ext[format]}`,
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime', '@virtuoso.dev/urx', '@virtuoso.dev/react-urx'],
},
},
test: {
include: ['test/**/*.test.{ts,tsx}'],
environment: 'jsdom',
},
})