@astrojs/cloudflare 6.6.0 → 6.6.1
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.
- package/README.md +1 -1
- package/dist/index.js +6 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ export default defineConfig({
|
|
|
66
66
|
In order for preview to work you must install `wrangler`
|
|
67
67
|
|
|
68
68
|
```sh
|
|
69
|
-
|
|
69
|
+
pnpm install wrangler --save-dev
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
It's then possible to update the preview script in your `package.json` to `"preview": "wrangler pages dev ./dist"`. This will allow you to run your entire application locally with [Wrangler](https://github.com/cloudflare/wrangler2), which supports secrets, environment variables, KV namespaces, Durable Objects and [all other supported Cloudflare bindings](https://developers.cloudflare.com/pages/platform/functions/#adding-bindings).
|
package/dist/index.js
CHANGED
|
@@ -70,7 +70,7 @@ function createIntegration(args) {
|
|
|
70
70
|
vite.ssr.target = "webworker";
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
"astro:build:ssr": ({
|
|
73
|
+
"astro:build:ssr": ({ entryPoints }) => {
|
|
74
74
|
_entryPoints = entryPoints;
|
|
75
75
|
},
|
|
76
76
|
"astro:build:done": async ({ pages, routes, dir }) => {
|
|
@@ -103,7 +103,7 @@ function createIntegration(args) {
|
|
|
103
103
|
write: false
|
|
104
104
|
});
|
|
105
105
|
for (const [index, outputFile] of outputFiles.entries()) {
|
|
106
|
-
const fileName = entryPointsRouteData[index].component.replace("src/pages/", "").replace(".astro", ".js").replace(/(\[\.\.\.)(\w+)(\])/g, (_match, _p1, p2
|
|
106
|
+
const fileName = entryPointsRouteData[index].component.replace("src/pages/", "").replace(".astro", ".js").replace(/(\[\.\.\.)(\w+)(\])/g, (_match, _p1, p2) => {
|
|
107
107
|
return `[[${p2}]]`;
|
|
108
108
|
});
|
|
109
109
|
const fileUrl = new URL(fileName, functionsUrl);
|
|
@@ -185,10 +185,12 @@ function createIntegration(args) {
|
|
|
185
185
|
staticPathList.push(...redirects);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
const redirectRoutes = routes.filter((r) => r.type === "redirect")
|
|
188
|
+
const redirectRoutes = routes.filter((r) => r.type === "redirect").map((r) => {
|
|
189
|
+
return [r, ""];
|
|
190
|
+
});
|
|
189
191
|
const trueRedirects = createRedirectsFromAstroRoutes({
|
|
190
192
|
config: _config,
|
|
191
|
-
|
|
193
|
+
routeToDynamicTargetMap: new Map(Array.from(redirectRoutes)),
|
|
192
194
|
dir
|
|
193
195
|
});
|
|
194
196
|
if (!trueRedirects.empty()) {
|
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": "6.6.
|
|
4
|
+
"version": "6.6.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"runtime.d.ts"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@astrojs/underscore-redirects": "^0.
|
|
35
|
+
"@astrojs/underscore-redirects": "^0.2.0",
|
|
36
36
|
"@cloudflare/workers-types": "^4.20230518.0",
|
|
37
37
|
"esbuild": "^0.17.19",
|
|
38
38
|
"tiny-glob": "^0.2.9"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"astro": "^2.
|
|
41
|
+
"astro": "^2.8.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"chai": "^4.3.7",
|
|
45
45
|
"cheerio": "1.0.0-rc.12",
|
|
46
46
|
"mocha": "^9.2.2",
|
|
47
47
|
"wrangler": "^2.0.23",
|
|
48
|
-
"astro": "2.
|
|
48
|
+
"astro": "2.8.2",
|
|
49
49
|
"astro-scripts": "0.0.14"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|