nitropack-nightly 2.12.5-20250819-193746.dc4f1a95 → 2.12.5-20250819-230311.89278001
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
|
@@ -52,7 +52,7 @@ const cloudflarePages = defineNitroPreset(
|
|
|
52
52
|
async compiled(nitro) {
|
|
53
53
|
await writeWranglerConfig(nitro, "pages");
|
|
54
54
|
await writeCFRoutes(nitro);
|
|
55
|
-
await writeCFHeaders(nitro);
|
|
55
|
+
await writeCFHeaders(nitro, "output");
|
|
56
56
|
await writeCFPagesRedirects(nitro);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -82,7 +82,7 @@ const cloudflarePagesStatic = defineNitroPreset(
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
async compiled(nitro) {
|
|
85
|
-
await writeCFHeaders(nitro);
|
|
85
|
+
await writeCFHeaders(nitro, "output");
|
|
86
86
|
await writeCFPagesRedirects(nitro);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -143,7 +143,7 @@ const cloudflareModule = defineNitroPreset(
|
|
|
143
143
|
},
|
|
144
144
|
async compiled(nitro) {
|
|
145
145
|
await writeWranglerConfig(nitro, "module");
|
|
146
|
-
await writeCFHeaders(nitro);
|
|
146
|
+
await writeCFHeaders(nitro, "public");
|
|
147
147
|
await writeFile(
|
|
148
148
|
resolve(nitro.options.output.dir, "package.json"),
|
|
149
149
|
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 writeCFHeaders(nitro: Nitro): Promise<void>;
|
|
3
|
+
export declare function writeCFHeaders(nitro: Nitro, outdir: "public" | "output"): 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,8 +75,11 @@ 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 writeCFHeaders(nitro) {
|
|
79
|
-
const headersPath = join(
|
|
78
|
+
export async function writeCFHeaders(nitro, outdir) {
|
|
79
|
+
const headersPath = join(
|
|
80
|
+
outdir === "public" ? nitro.options.output.publicDir : nitro.options.output.dir,
|
|
81
|
+
"_headers"
|
|
82
|
+
);
|
|
80
83
|
const contents = [];
|
|
81
84
|
const rules = Object.entries(nitro.options.routeRules).sort(
|
|
82
85
|
(a, b) => b[0].split(/\/(?!\*)/).length - a[0].split(/\/(?!\*)/).length
|
package/package.json
CHANGED