visua-vue/vite.config.ts
2025-07-31 01:50:55 +02:00

36 lines
853 B
TypeScript

// 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'],
output: {
globals: {
vue: 'Vue',
},
},
},
},
});