import path from 'path' import { defineConfig } from 'vite' import dts from 'vite-plugin-dts' export default defineConfig({ build: { lib: { entry: path.resolve(__dirname, "src/index.ts"), name: "@pdftron/chakra-theme", fileName: (format) => `index.${format}.js`, }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled // into your library external: ["react", "react-dom", "@chakra-ui/react", "@chakra-ui/icons", "@emotion/react", "framer-motion", "@emotion/styled", "@chakra-ui/theme-tools"], output: { // Provide global variables to use in the UMD build // for externalized deps globals: { react: 'react', '@chakra-ui/react': '@chakra-ui/react', "react-dom": "react-dom", "@chakra-ui/icons": "@chakra-ui/icons", "@emotion/react": "@emotion/react", "framer-motion": "framer-motion", "@emotion/styled": "@emotion/styled", "@chakra-ui/theme-tools": "@chakra-ui/theme-tools" } } }, }, plugins: [dts()] });