@sveltejs/adapter-cloudflare-workers
Advanced tools
Comparing version 1.0.0-next.16 to 1.0.0-next.17
# @sveltejs/adapter-cloudflare-workers | ||
## 1.0.0-next.17 | ||
### Patch Changes | ||
- e9f78999: fix: include esbuild config in adapter type definition | ||
## 1.0.0-next.16 | ||
@@ -4,0 +10,0 @@ |
@@ -1,3 +0,6 @@ | ||
declare function plugin(): import('@sveltejs/kit').Adapter; | ||
type BuildOptions = import('esbuild').BuildOptions; | ||
declare function plugin(options?: { | ||
esbuild?: (defaultOptions: BuildOptions) => Promise<BuildOptions> | BuildOptions; | ||
}): import('@sveltejs/kit').Adapter; | ||
export = plugin; |
14
index.js
@@ -14,5 +14,5 @@ import fs from 'fs'; | ||
* esbuild?: (defaultOptions: BuildOptions) => Promise<BuildOptions> | BuildOptions; | ||
* }} options | ||
* }} [options] | ||
**/ | ||
export default function (options = { esbuild: (opts) => opts }) { | ||
export default function (options) { | ||
/** @type {import('@sveltejs/kit').Adapter} */ | ||
@@ -42,3 +42,4 @@ const adapter = { | ||
const buildOptions = await options.esbuild({ | ||
/** @type {BuildOptions} */ | ||
const defaultOptions = { | ||
entryPoints: ['.svelte-kit/cloudflare-workers/entry.js'], | ||
@@ -48,5 +49,8 @@ outfile: `${entrypoint}/index.js`, | ||
target: 'es2020', | ||
platform: 'browser' // TODO would be great if we could generate ESM and use type = "javascript" | ||
}); | ||
platform: 'browser' | ||
}; | ||
const buildOptions = | ||
options && options.esbuild ? await options.esbuild(defaultOptions) : defaultOptions; | ||
await esbuild.build(buildOptions); | ||
@@ -53,0 +57,0 @@ |
{ | ||
"name": "@sveltejs/adapter-cloudflare-workers", | ||
"version": "1.0.0-next.16", | ||
"version": "1.0.0-next.17", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11101
152