Skip to content

Commit 9b70922

Browse files
committed
feat: allow custom esbuild options for workers adapter
1 parent f0c820b commit 9b70922

File tree

1 file changed

+5
-4
lines changed
  • packages/adapter-cloudflare-workers

1 file changed

+5
-4
lines changed

packages/adapter-cloudflare-workers/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import toml from '@iarna/toml';
66
import { fileURLToPath } from 'url';
77

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

@@ -53,12 +53,13 @@ export default function () {
5353
);
5454

5555
await esbuild.build({
56-
entryPoints: [`${tmp}/entry.js`],
57-
outfile: `${entrypoint}/${main_path}`,
5856
target: 'es2020',
5957
platform: 'browser',
58+
...options,
59+
entryPoints: [`${tmp}/entry.js`],
60+
outfile: `${entrypoint}/${main_path}`,
6061
bundle: true,
61-
external: ['__STATIC_CONTENT_MANIFEST'],
62+
external: ['__STATIC_CONTENT_MANIFEST', ...(options?.external || [])],
6263
format: 'esm'
6364
});
6465

0 commit comments

Comments
 (0)