Raw
1 import { defineConfig } from "tsup"
2
3 export default defineConfig({
4 entry: ["src/index.ts"],
5 format: ["cjs"],
6 dts: true,
7 clean: true,
8 /**
9 * Pinned so esbuild deterministically preserves the `await import()` calls
10 * that load `vite` and `@vitejs/plugin-react`. Both are ESM-only, so if
11 * esbuild downlevels those to `require()` the bundle still builds and
12 * typechecks, then throws ERR_REQUIRE_ESM at runtime. Enforced by
13 * `scripts/assert-esm-imports.mjs`, which runs as part of this package's build.
14 */
15 target: "node20",
16 })