import { defineConfig } from 'vite';

export default defineConfig(({ mode }) => ({
  root: '.',
  publicDir: false,
  build: {
    target: 'es2020',
    outDir: 'wwwroot/dist',
    emptyOutDir: true,
    assetsDir: '.',
    sourcemap: true,
    rollupOptions: {
      input: 'wwwroot/js/app.entry.js',
      output: {
        format: 'iife',
        entryFileNames: 'app.min.js',
        assetFileNames: '[name][extname]'
      }
    }
  }
}));
