@astrojs/cloudflare 12.5.4 → 12.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,13 @@ function createExports(manifest) {
49
49
  }
50
50
  }
51
51
  };
52
- const response = await app.render(request, { routeData, locals });
52
+ const response = await app.render(request, {
53
+ routeData,
54
+ locals,
55
+ prerenderedErrorPageFetch: async (url) => {
56
+ return env.ASSETS.fetch(url.replace(/\.html$/, ""));
57
+ }
58
+ });
53
59
  if (app.setCookieHeaders) {
54
60
  for (const setCookieHeader of app.setCookieHeaders(response)) {
55
61
  response.headers.append("Set-Cookie", setCookieHeader);
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  prependForwardSlash,
8
8
  removeLeadingForwardSlash
9
9
  } from "@astrojs/internal-helpers/path";
10
- import { createRedirectsFromAstroRoutes } from "@astrojs/underscore-redirects";
10
+ import { createRedirectsFromAstroRoutes, printAsRedirects } from "@astrojs/underscore-redirects";
11
11
  import { AstroError } from "astro/errors";
12
12
  import { defaultClientConditions } from "vite";
13
13
  import { getPlatformProxy } from "wrangler";
@@ -277,7 +277,10 @@ function createIntegration(args) {
277
277
  });
278
278
  if (!trueRedirects.empty()) {
279
279
  try {
280
- await appendFile(new URL("./_redirects", _config.outDir), trueRedirects.print());
280
+ await appendFile(
281
+ new URL("./_redirects", _config.outDir),
282
+ printAsRedirects(trueRedirects)
283
+ );
281
284
  } catch (_error) {
282
285
  logger.error("Failed to write _redirects file");
283
286
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
3
  "description": "Deploy your site to Cloudflare Workers/Pages",
4
- "version": "12.5.4",
4
+ "version": "12.5.5",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -34,7 +34,7 @@
34
34
  "vite": "^6.3.5",
35
35
  "wrangler": "^4.14.1",
36
36
  "@astrojs/internal-helpers": "0.6.1",
37
- "@astrojs/underscore-redirects": "0.6.1"
37
+ "@astrojs/underscore-redirects": "1.0.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "astro": "^5.0.0"
@@ -44,8 +44,8 @@
44
44
  "devalue": "^5.1.1",
45
45
  "execa": "^8.0.1",
46
46
  "rollup": "^4.40.2",
47
- "astro-scripts": "0.0.14",
48
- "astro": "5.9.0"
47
+ "astro": "5.9.4",
48
+ "astro-scripts": "0.0.14"
49
49
  },
50
50
  "publishConfig": {
51
51
  "provenance": true