Skip to content
Snippets Groups Projects
vite.config.ts 1.5 KiB
Newer Older
  • Learn to ignore specific revisions
  • Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
    import path from 'path'
    
    
    import { visualizer } from 'rollup-plugin-visualizer'
    import vue from '@vitejs/plugin-vue'
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
    import { defineConfig } from 'vite'
    
    import Components from 'unplugin-vue-components/vite'
    import Icons from 'unplugin-icons/vite'
    import IconsResolver from 'unplugin-icons/resolver'
    
    import { version } from './package.json'
    
    process.env.VUE_APP_VERSION = version
    
    
    export default defineConfig({
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
      base: '',
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
      // Traditionally we’ve used the VUE_ prefix for env variables as that was the default
      // environment variable prefix in the vue-cli/webpack based build system.
      // Migrating to the VITE_ prefix might be advisable in the future, but there
      // is no immediate need or benefit in doing so, so we support both.
      envPrefix: ['VUE_', 'VITE_'],
      server: {
        port: 8080,
        strictPort: true,
      },
      build: {
        rollupOptions: {
          input: {
            main: path.resolve(__dirname, 'index.html'),
            oidc_callback: path.resolve(__dirname, 'oidc_callback.html'),
            oidc_callback_silent_renew: path.resolve(__dirname, 'oidc_callback_silentRenew.html'),
          },
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
      },
      resolve: {
        alias: {
          vue: '@vue/compat',
          '@': path.resolve(__dirname, 'src'),
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
      },
      plugins: [
    
        visualizer(),
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
        vue({
          template: {
            compilerOptions: {
              compatConfig: {
                MODE: 2,
              },
    
        Components({
          dts: false,
          resolvers: [IconsResolver({ prefix: 'icon' })],
        }),
        Icons(),