Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adapter-cloudflare-workers prerendering bug [w/ reproduction] #4467

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: allow adapter-cloudflare-workers to take esbuild options
  • Loading branch information
f5io authored Mar 30, 2022
commit 822af0ff187ff68127bf39687c7a1b3c43479ef6
9 changes: 5 additions & 4 deletions packages/adapter-cloudflare-workers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import toml from '@iarna/toml';
import { fileURLToPath } from 'url';

/** @type {import('.')} */
export default function () {
export default function (options = {}) {
return {
name: '@sveltejs/adapter-cloudflare-workers',

Expand Down Expand Up @@ -50,11 +50,12 @@ export default function () {
);

await esbuild.build({
target: 'es2020',
platform: 'browser',
...options,
entryPoints: [`${tmp}/entry.js`],
outfile: `${entrypoint}/index.js`,
bundle: true,
target: 'es2020',
platform: 'browser'
bundle: true
});

writeFileSync(`${entrypoint}/package.json`, JSON.stringify({ main: 'index.js' }));
Expand Down