// vite.config.ts import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueDevTools from 'vite-plugin-vue-devtools' import path from 'path' export default defineConfig({ plugins: [ vue(), vueDevTools() ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), '@visua': path.resolve(__dirname, './node_modules/@cellule-financiere-pmo/visua/output'), }, }, build: { lib: { entry: path.resolve(__dirname, 'src/index.ts'), name: 'VisuaVue', fileName: (format) => format === 'es' ? 'visua-vue.es.js' : 'visua-vue.umd.cjs', formats: ['es', 'umd'], }, rollupOptions: { external: ['vue', 'primevue', 'vue-router', 'primeicons'], output: { globals: { vue: 'Vue', primevue: 'PrimeVue', 'vue-router': 'VueRouter', primeicons: 'primeicons' }, }, }, }, })