nitropack-nightly 2.11.9-20250403-232319.7e2e1015 → 2.11.9-20250404-154248.592f81c6

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.
@@ -1,3 +1,3 @@
1
- const version = "2.11.9-20250403-232319.7e2e1015";
1
+ const version = "2.11.9-20250404-154248.592f81c6";
2
2
 
3
3
  export { version };
@@ -6,6 +6,7 @@ import { parseTOML, parseJSONC } from "confbox";
6
6
  import { readGitConfig, readPackageJSON, findNearestFile } from "pkg-types";
7
7
  import { defu } from "defu";
8
8
  import { globby } from "globby";
9
+ import { provider } from "std-env";
9
10
  import { join, resolve } from "pathe";
10
11
  import {
11
12
  joinURL,
@@ -139,16 +140,19 @@ export async function writeCFPagesRedirects(nitro) {
139
140
  await writeFile(redirectsPath, contents.join("\n"), true);
140
141
  }
141
142
  export async function enableNodeCompat(nitro) {
142
- if (nitro.options.cloudflare?.nodeCompat === void 0) {
143
+ nitro.options.cloudflare ??= {};
144
+ if (nitro.options.cloudflare.deployConfig === void 0 && provider === "cloudflare_workers") {
145
+ nitro.options.cloudflare.deployConfig = true;
146
+ }
147
+ if (nitro.options.cloudflare.nodeCompat === void 0) {
143
148
  const { config } = await readWranglerConfig(nitro);
144
149
  const userCompatibilityFlags = new Set(config?.compatibility_flags || []);
145
- if (userCompatibilityFlags.has("nodejs_compat") || userCompatibilityFlags.has("nodejs_compat_v2")) {
146
- nitro.options.cloudflare ??= {};
150
+ if (userCompatibilityFlags.has("nodejs_compat") || userCompatibilityFlags.has("nodejs_compat_v2") || nitro.options.cloudflare.deployConfig) {
147
151
  nitro.options.cloudflare.nodeCompat = true;
148
152
  }
149
153
  }
150
- if (!nitro.options.cloudflare?.nodeCompat) {
151
- if (nitro.options.cloudflare?.nodeCompat === void 0) {
154
+ if (!nitro.options.cloudflare.nodeCompat) {
155
+ if (nitro.options.cloudflare.nodeCompat === void 0) {
152
156
  nitro.logger.warn("[cloudflare] Node.js compatibility is not enabled.");
153
157
  }
154
158
  return;
@@ -203,7 +207,13 @@ export async function writeWranglerConfig(nitro, cfTarget) {
203
207
  );
204
208
  overrides.assets = {
205
209
  binding: "ASSETS",
206
- directory: relative(wranglerConfigDir, nitro.options.output.publicDir)
210
+ directory: relative(
211
+ wranglerConfigDir,
212
+ resolve(
213
+ nitro.options.output.publicDir,
214
+ "..".repeat(nitro.options.baseURL.split("/").filter(Boolean).length)
215
+ )
216
+ )
207
217
  };
208
218
  }
209
219
  const { config: userConfig = {} } = await readWranglerConfig(nitro);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.11.9-20250403-232319.7e2e1015",
3
+ "version": "2.11.9-20250404-154248.592f81c6",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",