mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
cloudflare: enable fs with @cloudflare/vite-plugin (#239)
* init dev vite write plugin * reorganized cf proxy, fixed dev write
This commit is contained in:
@@ -1,7 +1,21 @@
|
||||
import type { CloudflareBkndConfig } from "bknd/adapter/cloudflare";
|
||||
import { syncTypes } from "bknd/plugins";
|
||||
import { writeFile } from "node:fs/promises";
|
||||
|
||||
const isDev = !import.meta.env.PROD;
|
||||
|
||||
export default {
|
||||
d1: {
|
||||
session: true,
|
||||
},
|
||||
options: {
|
||||
plugins: [
|
||||
syncTypes({
|
||||
enabled: isDev,
|
||||
write: async (et) => {
|
||||
await writeFile("bknd-types.d.ts", et.toString());
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
} satisfies CloudflareBkndConfig;
|
||||
|
||||
Reference in New Issue
Block a user