@sveltejs/adapter-cloudflare
Advanced tools
Comparing version 1.0.0-next.3 to 1.0.0-next.4
@@ -9,4 +9,12 @@ /* global ASSETS */ | ||
const url = new URL(req.url); | ||
// check generated asset_set for static files | ||
if (ASSETS.has(url.pathname.substring(1))) { | ||
let pathname = url.pathname.substring(1); | ||
try { | ||
pathname = decodeURIComponent(pathname); | ||
} catch (err) { | ||
// ignore | ||
} | ||
if (ASSETS.has(pathname)) { | ||
return env.ASSETS.fetch(req); | ||
@@ -13,0 +21,0 @@ } |
{ | ||
"name": "@sveltejs/adapter-cloudflare", | ||
"version": "1.0.0-next.3", | ||
"version": "1.0.0-next.4", | ||
"repository": { | ||
@@ -29,3 +29,3 @@ "type": "git", | ||
"devDependencies": { | ||
"@sveltejs/kit": "1.0.0-next.202" | ||
"@sveltejs/kit": "1.0.0-next.203" | ||
}, | ||
@@ -39,3 +39,4 @@ "publishConfig": { | ||
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore" | ||
} | ||
}, | ||
"readme": "# adapter-cloudflare\n\n[Adapter](https://kit.svelte.dev/docs#adapters) for building SvelteKit\napplications on Cloudflare Pages with Workers integration.\n\n_**Comparisons**_\n\n- `adapter-cloudflare` – supports all SvelteKit features; builds for\n [Cloudflare Pages](https://blog.cloudflare.com/cloudflare-pages-goes-full-stack/)\n- `adapter-cloudflare-workers` – supports all SvelteKit features; builds for\n Cloudflare Workers\n- `adapter-static` – only produces client-side static assets; compatible with\n Cloudflare Pages\n\n> **Note:** Cloudflare Pages' new Workers integration is currently in beta.<br/>\n> Compared to `adapter-cloudflare-workers`, this adapter will be the preferred approach for most users since building on top of Pages unlocks automatic builds and deploys, preview deployments, instant rollbacks, etc.<br/>\n> From SvelteKit's perspective, there is no difference and no functionality loss when migrating to/from the Workers and the Pages adapters.\n\n## Installation\n\n```sh\n$ npm i --save-dev @sveltejs/adapter-cloudflare@next\n```\n\n## Usage\n\nYou can include these changes in your `svelte.config.js` configuration file:\n\n```js\nimport cloudflare from '@sveltejs/adapter-cloudflare';\n\nexport default {\n\tkit: {\n\t\ttarget: '#svelte',\n\t\tadapter: cloudflare({\n\t\t\t// any esbuild options\n\t\t})\n\t}\n};\n```\n\n### Options\n\nThe adapter optionally accepts all\n[`esbuild.build`](https://esbuild.github.io/api/#build-api) configuration.\n\nThese are the default options, of which, all but `target` and `platform` are\nenforced:\n\n```js\ntarget: 'es2020',\nplatform: 'browser',\nentryPoints: '< input >',\noutfile: '<output>/_worker.js',\nallowOverwrite: true,\nformat: 'esm',\nbundle: true,\n```\n\n## Deployment\n\nPlease follow the [Get Started Guide](https://developers.cloudflare.com/pages/get-started) for Cloudflare Pages to begin.\n\nWhen configuring your project settings, you must use the following settings:\n\n- **Framework preset** – None\n- **Build command** – `npm run build` or `svelte-kit build`\n- **Build output directory** – `.svelte-kit/cloudflare`\n- **Environment variables**\n - `NODE_VERSION`: `16` or `14`\n\n> **Important:** You need to add a `NODE_VERSION` environment variable to both the \"production\" and \"preview\" environments. You can add this during project setup or later in the Pages project settings. SvelteKit requires Node `14.13` or later, so you should use `14` or `16` as the `NODE_VERSION` value.\n\n## Changelog\n\n[The Changelog for this package is available on\nGitHub](https://github.com/sveltejs/kit/blob/master/packages/adapter-cloudflare/CHANGELOG.md).\n" | ||
} |
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
10290
103