import react from '@vitejs/plugin-react'; import { resolve } from 'path'; import { defineConfig } from 'vite'; import svgr from 'vite-plugin-svgr'; import dts from 'vite-plugin-dts'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), svgr(), dts()], build: { lib: { entry: resolve(__dirname, 'src/components/index.ts'), formats: ['es'], }, rollupOptions: { external: ['react', 'react-dom'], output: { globals: { react: 'React', 'react-dom': 'ReactDOM' }, }, }, }, });