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

// https://vitejs.dev/config/
export default defineConfig({
  base: './page/',
  plugins: [vue()],
  build: {
    target: 'es2015',
    outDir: 'index',
    cssCodeSplit: true,
    minify: 'terser',
    sourcemap: false
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  server: {
    proxy: {
      "/api": {
        target: "https://www.i-montieri.com/",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      }
    }
  }
})
