Skip to content

Instantly share code, notes, and snippets.

@jedwards1211
Created August 15, 2023 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedwards1211/2118cbf23a73fd5eb76c72aaf38da9cd to your computer and use it in GitHub Desktop.
Save jedwards1211/2118cbf23a73fd5eb76c72aaf38da9cd to your computer and use it in GitHub Desktop.
Patch for using Nitro 2.5.2 with Cloudflare Pages
diff --git a/node_modules/nitropack/dist/shared/nitro.7a525996.mjs b/node_modules/nitropack/dist/shared/nitro.7a525996.mjs
index 90c7e4a..859bee1 100644
--- a/node_modules/nitropack/dist/shared/nitro.7a525996.mjs
+++ b/node_modules/nitropack/dist/shared/nitro.7a525996.mjs
@@ -1768,6 +1768,7 @@ export const plugins = [
conditions: [
"default",
nitro.options.dev ? "development" : "production",
+ "workerd",
"module",
"node",
"import"
@@ -1814,6 +1815,7 @@ export const plugins = [
"default",
nitro.options.dev ? "development" : "production",
"module",
+ "workerd",
"node",
"import"
]
@@ -1833,6 +1835,7 @@ export const plugins = [
"default",
nitro.options.dev ? "development" : "production",
"module",
+ "workerd",
"node",
"import"
]
@jedwards1211
Copy link
Author

Usage

  • Make a patches dir in your project and copy nitropack+2.5.2.patch to it
  • Add patch-package@^8.0.0 to your `devDependencies
  • Make a postinstall script run patch-package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment