diff --git a/web/public/_redirects b/web/public/_redirects deleted file mode 100644 index ad37e2c2..00000000 --- a/web/public/_redirects +++ /dev/null @@ -1 +0,0 @@ -/* /index.html 200 diff --git a/wrangler.jsonc b/wrangler.jsonc index adf78063..be159f6b 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -5,8 +5,16 @@ "observability": { "enabled": true }, + // Upload the *built* site, not the `web/` source tree. The static site is + // produced by the Cloudflare build command (`npm run build` in `web/`, + // which runs `vite build`). Pointing at `web` instead makes Wrangler walk + // `web/node_modules/jsnes` -- a symlink back to the repo root (the + // `"jsnes": "file:.."` dependency) -- recursing forever -> ELOOP. + // This path is resolved relative to the location of this config file. "assets": { - "directory": "web" + "directory": "web/dist", + // React Router SPA: serve index.html for unknown paths so deep links work. + "not_found_handling": "single-page-application" }, "compatibility_flags": [ "nodejs_compat"