-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
52 lines (44 loc) · 1.34 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
import dts from 'vite-plugin-dts';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig(() => {
return {
plugins: [
// Add TypeScript type checking
checker({
typescript: true,
}),
// Add React SWC transform plugin
react(),
// Enable TypeScript path aliases
tsconfigPaths(),
// Generate TypeScript declaration files
dts({
insertTypesEntry: true,
outDir: './dist', // Changed this to output to root directory
include: ['lib'], // Specify the source directory to generate types from
}),
],
build: {
lib: {
// Main entry point of your library
entry: resolve(__dirname, 'lib/index.ts'),
// Set library name for UMD builds
name: 'antd-form-composer',
// Configure output filename format
fileName: (format) => `index.${format}.js`,
// Specify which formats to build
// 'es' - for ESM (import/export)
// 'umd' - for CommonJS and UMD
formats: ['es', 'umd'],
},
rollupOptions: {
// Mark React as external dependency
external: ['react', 'antd'],
},
},
};
});