buster/packages/ui-components/vite.config.ts

26 lines
664 B
TypeScript
Raw Normal View History

2025-07-24 01:20:35 +08:00
import { resolve } from 'node:path';
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [react(), tailwindcss()],
2025-07-24 01:20:35 +08:00
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
formats: ['es'],
},
rollupOptions: {
external: ['react', 'react-dom'],
output: {
// Preserve the directory structure for better tree-shaking
preserveModules: true,
preserveModulesRoot: 'src',
},
},
sourcemap: true,
// Ensure TypeScript declarations are generated
emptyOutDir: false,
},
});