import path from 'path' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], build: { cssCodeSplit: true, lib: { entry: path.resolve(__dirname, 'src/index.ts'), name: 'weather-widgets-vue', fileName: format => `weather-widget-vue-${format}.js`, }, rollupOptions: { external: ['vue'], output: { exports: 'named', globals: { vue: 'Vue', }, }, }, emptyOutDir: false, // to retain the types folder generated by tsc }, })