diff --git a/.changeset/silver-bears-melt.md b/.changeset/silver-bears-melt.md new file mode 100644 index 000000000000..924cc3a40fa7 --- /dev/null +++ b/.changeset/silver-bears-melt.md @@ -0,0 +1,8 @@ +--- +'@sveltejs/adapter-cloudflare-workers': patch +'@sveltejs/adapter-cloudflare': patch +'@sveltejs/adapter-netlify': patch +'@sveltejs/adapter-vercel': patch +--- + +fix: copy `.eot`, `.otf`, `.ttf`, `.woff`, and `woff2` font files when bundling diff --git a/packages/adapter-cloudflare-workers/index.js b/packages/adapter-cloudflare-workers/index.js index df592eea4ffe..cb886a0edf66 100644 --- a/packages/adapter-cloudflare-workers/index.js +++ b/packages/adapter-cloudflare-workers/index.js @@ -97,7 +97,12 @@ export default function ({ config = 'wrangler.toml', platformProxy = {} } = {}) alias: Object.fromEntries(compatible_node_modules.map((id) => [id, `node:${id}`])), format: 'esm', loader: { - '.wasm': 'copy' + '.wasm': 'copy', + '.woff': 'copy', + '.woff2': 'copy', + '.ttf': 'copy', + '.eot': 'copy', + '.otf': 'copy' }, logLevel: 'silent' }); diff --git a/packages/adapter-cloudflare/index.js b/packages/adapter-cloudflare/index.js index 7ec6539862bf..413f1807930b 100644 --- a/packages/adapter-cloudflare/index.js +++ b/packages/adapter-cloudflare/index.js @@ -90,7 +90,12 @@ export default function (options = {}) { format: 'esm', bundle: true, loader: { - '.wasm': 'copy' + '.wasm': 'copy', + '.woff': 'copy', + '.woff2': 'copy', + '.ttf': 'copy', + '.eot': 'copy', + '.otf': 'copy' }, external, alias: Object.fromEntries(compatible_node_modules.map((id) => [id, `node:${id}`])), diff --git a/packages/adapter-netlify/index.js b/packages/adapter-netlify/index.js index 8f8a1c5eecd4..f843ed46b809 100644 --- a/packages/adapter-netlify/index.js +++ b/packages/adapter-netlify/index.js @@ -167,7 +167,14 @@ async function generate_edge_functions({ builder }) { platform: 'browser', sourcemap: 'linked', target: 'es2020', - + loader: { + '.wasm': 'copy', + '.woff': 'copy', + '.woff2': 'copy', + '.ttf': 'copy', + '.eot': 'copy', + '.otf': 'copy' + }, // Node built-ins are allowed, but must be prefixed with `node:` // https://docs.netlify.com/edge-functions/api/#runtime-environment external: builtinModules.map((id) => `node:${id}`), diff --git a/packages/adapter-vercel/index.js b/packages/adapter-vercel/index.js index 11d7223dfa0f..46a3e00bdf68 100644 --- a/packages/adapter-vercel/index.js +++ b/packages/adapter-vercel/index.js @@ -134,7 +134,12 @@ const plugin = function (defaults = {}) { sourcemap: 'linked', banner: { js: 'globalThis.global = globalThis;' }, loader: { - '.wasm': 'copy' + '.wasm': 'copy', + '.woff': 'copy', + '.woff2': 'copy', + '.ttf': 'copy', + '.eot': 'copy', + '.otf': 'copy' } });