import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
  define: {
    'process.env.NODE_ENV': JSON.stringify('production'),
  },
  plugins: [
    vue({
      customElement: true,
    }),
  ],
  build: {
    lib: {
      entry: 'src/register.ts',
      name: 'UserMenu',
      formats: ['es', 'iife'],
      fileName: (format) => `user-menu.${format}.js`,
    },
  },
});
