mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
cli create: updated templates, reworked examples to be standalone
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
import { $ } from "bun";
|
||||
//import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill";
|
||||
import esbuild from "esbuild";
|
||||
|
||||
const result = await esbuild.build({
|
||||
//plugins: [NodeModulesPolyfillPlugin()],
|
||||
platform: "browser",
|
||||
conditions: ["worker", "browser"],
|
||||
entryPoints: ["./src/index.ts"],
|
||||
outdir: "dist",
|
||||
external: ["__STATIC_CONTENT_MANIFEST", "cloudflare:workers"],
|
||||
format: "esm",
|
||||
target: "es2022",
|
||||
keepNames: true,
|
||||
bundle: true,
|
||||
metafile: true,
|
||||
minify: true,
|
||||
loader: {
|
||||
".html": "copy"
|
||||
},
|
||||
define: {
|
||||
IS_CLOUDFLARE_WORKER: "true"
|
||||
}
|
||||
});
|
||||
|
||||
await Bun.write("dist/meta.json", JSON.stringify(result.metafile));
|
||||
await $`gzip dist/index.js -c > dist/index.js.gz`;
|
||||
@@ -4,19 +4,17 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"deploy": "wrangler deploy",
|
||||
"db": "turso dev",
|
||||
"dev": "wrangler dev",
|
||||
"start": "wrangler dev",
|
||||
"test": "vitest",
|
||||
"cf-typegen": "wrangler types"
|
||||
},
|
||||
"dependencies": {
|
||||
"bknd": "workspace:*",
|
||||
"bknd": "file:../../app",
|
||||
"kysely-d1": "^0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20241106.0",
|
||||
"typescript": "^5.5.2",
|
||||
"wrangler": "^3.86.0"
|
||||
"@cloudflare/workers-types": "^4.20240620.0",
|
||||
"typescript": "^5.5.3",
|
||||
"wrangler": "^3.108.1"
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#:schema node_modules/wrangler/config-schema.json
|
||||
name = "bknd-cf-worker-example"
|
||||
main = "src/index.ts"
|
||||
compatibility_date = "2025-02-04"
|
||||
compatibility_flags = ["nodejs_compat"]
|
||||
workers_dev = true
|
||||
minify = true
|
||||
assets = { directory = "../../app/dist/static" }
|
||||
|
||||
[observability]
|
||||
enabled = true
|
||||
|
||||
[[d1_databases]]
|
||||
binding = "DB"
|
||||
database_name = "bknd-cf-example"
|
||||
database_id = "7ad67953-2bbf-47fc-8696-f4517dbfe674"
|
||||
|
||||
[[r2_buckets]]
|
||||
binding = "BUCKET"
|
||||
bucket_name = "bknd-cf-example"
|
||||
Reference in New Issue
Block a user