import { resolve } from 'path' import { defineConfig, splitVendorChunkPlugin } from 'vite' import dts from 'vite-plugin-dts' import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), splitVendorChunkPlugin(), dts({ insertTypesEntry: true }) ], build: { lib: { // src/indext.ts is where we have exported the component(s) entry: resolve(__dirname, 'src'), name: 'EspritDesign', fileName: 'esprit-design' }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled // into your library external: ['vue', 'gsap'], output: { // Provide global variables to use in the UMD build // for externalized deps globals: { vue: 'Vue' } } } } })