import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
import { viteSingleFile } from "vite-plugin-singlefile";
import ansi from "./vite-plugin-ansi";

export default defineConfig({
  plugins: [
    ansi(),
    tailwindcss(),
    viteSingleFile({ useRecommendedBuildConfig: false }),
  ],
  resolve: {
    alias: {
      "~": "/src",
    },
  },
  server: {
    headers: {
      "Cache-Control": "no-store",
      "Cross-Origin-Opener-Policy": "same-origin",
      "Cross-Origin-Embedder-Policy": "require-corp",
    },
  },
  preview: {
    headers: {
      "Cache-Control": "no-store",
      "Cross-Origin-Opener-Policy": "same-origin",
      "Cross-Origin-Embedder-Policy": "require-corp",
    },
  },
  build: {
    target: "esnext",
    assetsInlineLimit: 0,
    cssCodeSplit: false,
    cssMinify: false,
  },
});
