nitropack-nightly 2.11.13-20250625-143935.88d57459 → 2.11.14-20250704-082224.ac3df32d
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/dist/meta/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
enableNodeCompat,
|
|
7
7
|
writeWranglerConfig,
|
|
8
8
|
writeCFRoutes,
|
|
9
|
-
|
|
9
|
+
writeCFHeaders,
|
|
10
10
|
writeCFPagesRedirects
|
|
11
11
|
} from "./utils.mjs";
|
|
12
12
|
import cfLegacyPresets from "./preset-legacy.mjs";
|
|
@@ -48,7 +48,7 @@ const cloudflarePages = defineNitroPreset(
|
|
|
48
48
|
async compiled(nitro) {
|
|
49
49
|
await writeWranglerConfig(nitro, "pages");
|
|
50
50
|
await writeCFRoutes(nitro);
|
|
51
|
-
await
|
|
51
|
+
await writeCFHeaders(nitro);
|
|
52
52
|
await writeCFPagesRedirects(nitro);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -72,7 +72,7 @@ const cloudflarePagesStatic = defineNitroPreset(
|
|
|
72
72
|
},
|
|
73
73
|
hooks: {
|
|
74
74
|
async compiled(nitro) {
|
|
75
|
-
await
|
|
75
|
+
await writeCFHeaders(nitro);
|
|
76
76
|
await writeCFPagesRedirects(nitro);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -114,6 +114,7 @@ const cloudflareModule = defineNitroPreset(
|
|
|
114
114
|
},
|
|
115
115
|
async compiled(nitro) {
|
|
116
116
|
await writeWranglerConfig(nitro, "module");
|
|
117
|
+
await writeCFHeaders(nitro);
|
|
117
118
|
await writeFile(
|
|
118
119
|
resolve(nitro.options.output.dir, "package.json"),
|
|
119
120
|
JSON.stringify({ private: true, main: "./server/index.mjs" }, null, 2)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Nitro } from "nitropack/types";
|
|
2
2
|
export declare function writeCFRoutes(nitro: Nitro): Promise<void>;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function writeCFHeaders(nitro: Nitro): Promise<void>;
|
|
4
4
|
export declare function writeCFPagesRedirects(nitro: Nitro): Promise<void>;
|
|
5
5
|
export declare function enableNodeCompat(nitro: Nitro): Promise<void>;
|
|
6
6
|
export declare function writeWranglerConfig(nitro: Nitro, cfTarget: "pages" | "module"): Promise<void>;
|
|
@@ -75,7 +75,7 @@ export async function writeCFRoutes(nitro) {
|
|
|
75
75
|
function comparePaths(a, b) {
|
|
76
76
|
return a.split("/").length - b.split("/").length || a.localeCompare(b);
|
|
77
77
|
}
|
|
78
|
-
export async function
|
|
78
|
+
export async function writeCFHeaders(nitro) {
|
|
79
79
|
const headersPath = join(nitro.options.output.dir, "_headers");
|
|
80
80
|
const contents = [];
|
|
81
81
|
const rules = Object.entries(nitro.options.routeRules).sort(
|
package/package.json
CHANGED