import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [uni()],
  base: '/insurance/',
  resolve: {
    alias: {
      '@': resolve(__dirname, '.'),
      '~': resolve(__dirname)
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "./styles/variables.scss";`
      }
    }
  },
  server: {
    port: 3000,
    open: false
  },
  build: {
    target: 'es6',
    cssCodeSplit: false,
    rollupOptions: {
      output: {
        manualChunks: {
          'uni-app': ['@dcloudio/uni-app']
        }
      }
    }
  }
})