-
-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (31 loc) · 708 Bytes
/
Copy pathvite.config.ts
File metadata and controls
32 lines (31 loc) · 708 Bytes
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
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [
react(),
dts({
include: ['src/**/*'],
exclude: ['**/*.test.*'],
insertTypesEntry: true,
}),
],
build: {
lib: {
entry: resolve(import.meta.dirname, 'src/index.tsx'),
formats: ['es', 'cjs'],
fileName: (format) => `mui-rff.${format === 'es' ? 'esm' : 'cjs'}.js`,
},
rollupOptions: {
external: [/node_modules/, /react/, /@mui/, /react-final-form/],
},
sourcemap: true,
outDir: 'dist',
emptyOutDir: true,
},
test: {
environment: 'jsdom',
globals: true,
},
});