@astrojs/cloudflare
Advanced tools
Comparing version 0.2.0 to 0.2.1
# @astrojs/cloudflare | ||
## 0.2.1 | ||
### Patch Changes | ||
- [#3695](https://github.com/withastro/astro/pull/3695) [`0d667d0e`](https://github.com/withastro/astro/commit/0d667d0e572d76d4c819816ddf51ed14b43e2551) Thanks [@nrgnrg](https://github.com/nrgnrg)! - fix custom 404 pages not rendering | ||
## 0.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -14,2 +14,6 @@ import "./shim.js"; | ||
} | ||
const _404Request = new Request(`${origin}/404`, request); | ||
if (app.match(_404Request)) { | ||
return app.render(_404Request); | ||
} | ||
return new Response(null, { | ||
@@ -16,0 +20,0 @@ status: 404, |
{ | ||
"name": "@astrojs/cloudflare", | ||
"description": "Deploy your site to cloudflare pages functions", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"type": "module", | ||
@@ -25,3 +25,3 @@ "types": "./dist/index.d.ts", | ||
"devDependencies": { | ||
"astro": "1.0.0-beta.47", | ||
"astro": "1.0.0-beta.55", | ||
"astro-scripts": "0.0.4" | ||
@@ -28,0 +28,0 @@ }, |
@@ -25,1 +25,9 @@ # @astrojs/cloudflare | ||
It's then possible to update the preview script in your `package.json` to `"preview": "wrangler pages dev ./dist"` | ||
## Streams | ||
Some integrations such as (react)[https://github.com/withastro/astro/tree/main/packages/integrations/react] rely on web streams. Currently Cloudflare Pages functions are in beta and don't support the `streams_enable_constructors` feature flag. | ||
In order to work around this: | ||
- install the `"web-streams-polyfill"` package | ||
- add `import "web-streams-polyfill/es2018";` to the top of the front matter of every page which requires streams, such as server rendering a React component. |
@@ -27,2 +27,7 @@ import './shim.js'; | ||
// 404 | ||
const _404Request = new Request(`${origin}/404`, request); | ||
if (app.match(_404Request)) { | ||
return app.render(_404Request); | ||
} | ||
return new Response(null, { | ||
@@ -29,0 +34,0 @@ status: 404, |
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
12765
223
32