Fix building for Cloudflare Nitro preset (#1726)

It seems that Rollup node-resolve module doesn't properly deal with
trailing slashes, causing it to thing that `string_decoder` is a
built-in Node.js dependency and attempt to import it from `unenv`, which
will obviously fail, because `string_decoder` is not, in fact, a Node.js
dependency, but an individual dependency of `readable-stream`.

This adds a small patch for `readable-stream@2.3.8` dependency, which
removes the leading slash, which seems to fix the builds.

This probably should be reported to relevant developers (Rollup
node-resolve plugin or Nitro?).
This commit is contained in:
Sasha Sorokin
2024-06-15 00:26:12 +02:00
committed by GitHub
parent 5db5f2251f
commit e0a9e62d84
3 changed files with 30 additions and 4 deletions

View File

@@ -57,7 +57,8 @@
"packageManager": "pnpm@9.3.0",
"pnpm": {
"patchedDependencies": {
"markdown-it@13.0.1": "patches/markdown-it@13.0.1.patch"
"markdown-it@13.0.1": "patches/markdown-it@13.0.1.patch",
"readable-stream@2.3.8": "patches/readable-stream@2.3.8.patch"
}
}
}