Add TypeScript declaration files support with vite-plugin-dts

This commit is contained in:
hibna
2025-10-29 11:05:54 +03:00
parent 516a1aabbd
commit 64b2bd9383
5 changed files with 622 additions and 37 deletions
+10 -1
View File
@@ -1,10 +1,19 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import dts from 'vite-plugin-dts'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
dts({
include: ['src/**/*'],
exclude: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'examples'],
outDir: 'dist',
insertTypesEntry: true,
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),