Skip to content

fix(deploy): emit additional modules in framework Worker bundles - #537

Closed
Pleasurecruise wants to merge 2 commits into
voidzero-dev:mainfrom
Pleasurecruise:fix/cf-modules
Closed

Pleasurecruise wants to merge 2 commits into
voidzero-dev:mainfrom
Pleasurecruise:fix/cf-modules

Conversation

@Pleasurecruise

@Pleasurecruise Pleasurecruise commented Oct 21, 2026 •

Copy link
Copy Markdown

prepareBundledBuildOutput re-bundles framework Worker output with a plain Vite lib build, so .wasm, .bin, .txt, .html and .sql imports were bundled as JavaScript. This adds a plugin that mirrors @cloudflare/vite-plugin's additional modules: same rules, resolves # subpath imports, keeps matches external, and emits each file in renderChunk with a chunk-relative path. copyBundle then uploads them with their existing module types.

The Cloudflare plugin does not export this logic, so it is reimplemented here. It applies to every bundle built by prepareBundledBuildOutput, including the static Worker, where it is a no-op.

Test

  • New unit test: wasm-bindgen-style and plain Wasm, text and data imports, a # subpath import and a dynamic import become wasm/text/data modules and pass cf dry-run. Fails without the fix.
  • vp test run packages/void/test/unit/cf-build-output.test.ts and vp run --filter ./packages/void typecheck pass.
  • Verified against a real SvelteKit app using @resvg/resvg-wasm.

Pleasurecruise added a commit to Pleasurecruise/my-memos that referenced this pull request Oct 21, 2026
Pleasurecruise added a commit to Pleasurecruise/my-memos that referenced this pull request Oct 21, 2026
- Replace wrangler.json/void.json with void.config.ts and void.lock.json
- Move SQL migrations to apps/memos/db/migrations and apply them with
  `void db migrate`; drop the cf-config script and the direct wrangler dependency
- Deploy with `void deploy --platform cloudflare`, including Workers Builds;
  manage secrets with `void secret`
- Use the SvelteKit adapter's _worker.js as the Worker entry and drop worker.ts
- Patch void 1.1.12 to keep Wasm, text and data imports as Worker modules,
  backporting voidzero-dev/void#537 until it is released
- Upgrade void to 1.1.12, vite-plus to 1.3.0, SvelteKit 3.1 and other outdated deps
- Render `---` under text as a thematic break by disabling setext headings
Pleasurecruise added a commit to Pleasurecruise/my-memos that referenced this pull request Oct 21, 2026
- Replace wrangler.json/void.json with void.config.ts and void.lock.json
- Move SQL migrations to apps/memos/db/migrations and apply them with
  `void db migrate`; drop the cf-config script and the direct wrangler dependency
- Deploy with `void deploy --platform cloudflare`, including Workers Builds;
  manage secrets with `void secret`
- Set preview_urls to false so Void can republish the existing Worker's traffic settings
- Use the SvelteKit adapter's _worker.js as the Worker entry and drop worker.ts
- Patch void 1.1.12 to keep Wasm, text and data imports as Worker modules,
  backporting voidzero-dev/void#537 until it is released
- Upgrade void to 1.1.12, vite-plus to 1.3.0, SvelteKit 3.1 and other outdated deps
- Render `---` under text as a thematic break by disabling setext headings
Pleasurecruise added a commit to Pleasurecruise/my-memos that referenced this pull request Oct 21, 2026
- Replace wrangler.json/void.json with void.config.ts and void.lock.json
- Move SQL migrations to apps/memos/db/migrations and apply them with
  `void db migrate`; drop the cf-config script and the direct wrangler dependency
- Deploy with `void deploy --platform cloudflare`, including Workers Builds;
  manage secrets with `void secret`
- Set preview_urls to false so Void can republish the existing Worker's traffic settings
- Use the SvelteKit adapter's _worker.js as the Worker entry and drop worker.ts
- Patch void 1.1.12 to keep Wasm, text and data imports as Worker modules
  (backports voidzero-dev/void#537) and to resolve packages with workerd
  conditions when it re-bundles the Worker
- Upgrade void to 1.1.12, vite-plus to 1.3.0, SvelteKit 3.1 and other outdated deps
- Render `---` under text as a thematic break by disabling setext headings
@Pleasurecruise
Pleasurecruise deleted the fix/cf-modules branch October 21, 2026 22:05
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.

1 participant