import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import path from 'path'; export default defineConfig({ plugins: [react()], resolve: { alias: { '@atoms': path.resolve(__dirname, 'src/components/atoms'), '@molecules': path.resolve(__dirname, 'src/components/molecules'), '@organisms': path.resolve(__dirname, 'src/components/organisms'), '@theme': path.resolve(__dirname, 'src/theme'), }, }, build: { lib: { entry: path.resolve(__dirname, 'src/index.ts'), formats: ['es'], fileName: 'index', }, rollupOptions: { external: [ 'react', 'react-dom', 'react/jsx-runtime', '@mui/material', '@mui/material/styles', '@mui/system', '@mui/icons-material', '@emotion/react', '@emotion/styled', ], output: { globals: { react: 'React', 'react-dom': 'ReactDOM', }, }, }, outDir: 'dist', sourcemap: true, }, });