Repository navigation
Expand file tree
/
Copy pathwrangler.toml
More file actions
51 lines (45 loc) · 2.66 KB
/
Copy pathwrangler.toml
File metadata and controls
51 lines (45 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name = "rustcfml-site"
main = "build/worker/shim.mjs"
# Matches the reference worker host. Dates from 2026-08-04 enable nodejs_compat
# by default, but the flag is listed explicitly below, so a newer date buys
# nothing — and `wrangler dev` refuses any date its bundled runtime predates.
compatibility_date = "2026-05-25"
compatibility_flags = ["nodejs_compat"]
# A workers.dev URL for testing, alongside whatever custom domain is live.
workers_dev = true
# The apex. Cloudflare creates the DNS record and certificate for it on deploy,
# and points every path at this Worker; static assets above are still answered
# before the Worker runs. Add `zone_name = "rustcfml.org"` if a deploy cannot
# infer the zone.
[[routes]]
pattern = "rustcfml.org"
custom_domain = true
# www answers only to redirect to the apex, which is what sitemap.xml and
# robots.txt name as canonical. A plain route rather than a custom domain:
# the zone already has a proxied CNAME for www, and a route binds to an
# existing proxied record, where a custom domain would want to create its
# own and collide with it.
[[routes]]
pattern = "www.rustcfml.org/*"
zone_name = "rustcfml.org"
# Static assets: anything present here is served directly, without invoking
# (or billing for) the Worker. Anything else falls through to the Worker,
# which is how the CFML pages get served. `public/` is generated by
# scripts/stage-assets.sh during the build below.
[assets]
directory = "./public"
[build]
# stage-assets — copies assets/, robots.txt and sitemap.xml into public/.
# ESBUILD_BIN — wrapper that forces --platform=node so the JSPI snippet's
# Node built-ins resolve under nodejs_compat.
# NO_MINIFY — keeps wasm-bindgen identifiers readable for jspi-patch.mjs.
# worker-build — pinned to match the `worker` crate: 0.8.5 passes
# --force-enable-abort-handler, which fails on this setup.
# The worker-build install is skipped when the pinned version is already on
# PATH: CI caches ~/.cargo/bin, and a plain `cargo install` over a restored
# binary fails with "already exists in destination" rather than no-opping.
command = "sh scripts/stage-assets.sh && { [ \"$(worker-build --version 2>/dev/null)\" = \"0.8.3\" ] || cargo install -q --force worker-build --version 0.8.3; } && ESBUILD_BIN=$PWD/scripts/esbuild-wrapper.sh NO_MINIFY=1 worker-build --release && node jspi-patch.mjs"
# No KV, Durable Object, Hyperdrive or cron bindings: this site never touches
# session scope or a datasource, and its application scope is static config
# rebuilt by onApplicationStart in each isolate. Add them back from the
# reference host (RustCFML-Cloudflare-worker) if that stops being true.