sailfork / t3code-github / .repos/ alchemy-effect/ packages/ integration-tests/ test/ Cloudflare/ Website/ vite-fixture/ vite.config.ts

import { defineConfig } from "vite";

// `Cloudflare.Website.Vite` declares an `ssr` environment but doesn't set a
// worker entry by default. For non-framework projects (no React/Vue
// plugin to inject one), Vite 8 errors out with "rollupOptions.input
// should not be an html file when building for SSR". We point the SSR
// build at our minimal worker entry so the cloudflare-vite-plugin can
// wrap it into the worker bundle.
export default defineConfig({
  environments: {
    ssr: {
      build: {
        rollupOptions: {
          input: "./src/worker.ts",
        },
      },
    },
  },
});