Skip to content

fix(deploy): honor cloudflare.assets.html_handling on static CF deploy - #588

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
0froq:fix/cf-static-html-handling
Oct 26, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
0froq:fix/cf-static-html-handling

Conversation

@0froq

@0froq 0froq commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #580

Summary

Static void deploy --platform cloudflare always wrote assets.html_handling: auto-trailing-slash into the generated wrangler-static.json, ignoring cloudflare.assets.html_handling from void.config.ts / the materialized root Wrangler config. That caused extra 307 redirects for prerendered sites using about/index.html with links to /about.

Changes

  • Read assets.html_handling from the root Wrangler config at static deploy time.
  • Pass it through buildStaticManifest into manifest.assetConfig so writeCloudflareStaticDeployConfig persists the authored value.
  • Type cloudflare.assets.html_handling in Void config as AssetConfig['html_handling'] from @void/deploy-core (no duplicated union).

Testing

  • packages/void/test/unit/package.test.ts (manifest + wrangler reader)
  • packages/deploy-cloudflare/test/unit/static.test.ts (config writer)
  • packages/void/test/unit/cloudflare-deploy.test.ts (end-to-end static deploy)

Fixes voidzero-dev#580

## Summary

Static `void deploy --platform cloudflare` always wrote `assets.html_handling: auto-trailing-slash` into the generated `wrangler-static.json`, ignoring `cloudflare.assets.html_handling` from `void.config.ts` / the materialized root Wrangler config. That caused extra 307 redirects for prerendered sites using `about/index.html` with links to `/about`.

## Changes

- Read `assets.html_handling` from the root Wrangler config at static deploy time.
- Pass it through `buildStaticManifest` into `manifest.assetConfig` so `writeCloudflareStaticDeployConfig` persists the authored value.
- Type `cloudflare.assets.html_handling` in Void config as `AssetConfig['html_handling']` from `@void/deploy-core` (no duplicated union).

## Testing

- `packages/void/test/unit/package.test.ts` (manifest + wrangler reader)
- `packages/deploy-cloudflare/test/unit/static.test.ts` (config writer)
- `packages/void/test/unit/cloudflare-deploy.test.ts` (end-to-end static deploy)

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cpojer
cpojer merged commit 9337ed4 into voidzero-dev:main Oct 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static Cloudflare deploy ignores cloudflare.assets.html_handling

3 participants