Skip to content

Commit

Permalink
fix: Set loader: { '.wasm': 'copy' } in esbuild config in `adapter-cl…
Browse files Browse the repository at this point in the history
…oudflare-workers` (#9940)

* fix: Set loader: { '.wasm': 'copy' } in esbuild config in `adapter-cloudflare-workers`

Copies WASM files in Cloudflare instead of trying to load them.

Related to #9909

* Create brave-peaches-buy.md

* Update packages/adapter-cloudflare-workers/index.js

* format

---------

Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Rich Harris <[email protected]>
  • Loading branch information
3 people authored May 16, 2023
1 parent 4a85b7f commit bbf3101
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brave-peaches-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/adapter-cloudflare-workers": patch
---

fix: Copy .wasm files during build
5 changes: 4 additions & 1 deletion packages/adapter-cloudflare-workers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export default function ({ config = 'wrangler.toml' } = {}) {
outfile: main,
bundle: true,
external: ['__STATIC_CONTENT_MANIFEST'],
format: 'esm'
format: 'esm',
loader: {
'.wasm': 'copy'
}
});

builder.log.minor('Copying assets...');
Expand Down

0 comments on commit bbf3101

Please sign in to comment.