mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 21:06:04 +00:00
public commit
This commit is contained in:
48
app/tsup.adapters.ts
Normal file
48
app/tsup.adapters.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { type Options, build } from "tsup";
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
const watch = args.includes("--watch");
|
||||
const minify = args.includes("--minify");
|
||||
|
||||
function baseConfig(adapter: string): Options {
|
||||
return {
|
||||
entry: [`src/adapter/${adapter}`],
|
||||
format: ["esm"],
|
||||
platform: "neutral",
|
||||
minify,
|
||||
outDir: `dist/adapter/${adapter}`,
|
||||
watch,
|
||||
define: {
|
||||
__isDev: "0"
|
||||
},
|
||||
external: [new RegExp(`^(?!\\.\\/src\\/adapter\\/${adapter}\\/).+$`)],
|
||||
metafile: true,
|
||||
splitting: false,
|
||||
treeshake: true
|
||||
};
|
||||
}
|
||||
|
||||
await build({
|
||||
...baseConfig("vite"),
|
||||
platform: "node"
|
||||
});
|
||||
|
||||
await build({
|
||||
...baseConfig("cloudflare")
|
||||
});
|
||||
|
||||
await build({
|
||||
...baseConfig("nextjs"),
|
||||
format: ["esm", "cjs"],
|
||||
platform: "node"
|
||||
});
|
||||
|
||||
await build({
|
||||
...baseConfig("remix"),
|
||||
format: ["esm", "cjs"]
|
||||
});
|
||||
|
||||
await build({
|
||||
...baseConfig("bun")
|
||||
});
|
||||
Reference in New Issue
Block a user