import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { ViteEjsPlugin } from "vite-plugin-ejs";
import eslint from "vite-plugin-eslint";

export default defineConfig({
  base: "./",
  plugins: [
    ViteEjsPlugin((viteConfig) => {
      // viteConfig is the current Vite resolved config
      return { env: viteConfig.env };
    }),
    react(),
    //eslint()
    // CompressionPlugin(), //Cloudfront already compresses assets, so not needed.
  ],
  define: {
    APP_VERSION: JSON.stringify(process.env.npm_package_version)
  },
  server: {
    host: true,
    port: 3006,
    open: true
  },
  build: {
    outDir: "build",
    sourcemap: false
  }
});
