Parcourir la source

fix(npm): Arborist reify fails on compiled binary — Bun pre-resolves node-gyp path at build time (#21040)

Dax il y a 1 semaine
Parent
commit
629e866ff0
2 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 1 0
      packages/opencode/script/build.ts
  2. 2 0
      packages/opencode/src/npm/index.ts

+ 1 - 0
packages/opencode/script/build.ts

@@ -209,6 +209,7 @@ for (const item of targets) {
     conditions: ["browser"],
     tsconfig: "./tsconfig.json",
     plugins: [plugin],
+    external: ["node-gyp"],
     compile: {
       autoloadBunfig: false,
       autoloadDotenv: false,

+ 2 - 0
packages/opencode/src/npm/index.ts

@@ -67,6 +67,7 @@ export namespace Npm {
       binLinks: true,
       progress: false,
       savePrefix: "",
+      ignoreScripts: true,
     })
     const tree = await arborist.loadVirtual().catch(() => {})
     if (tree) {
@@ -106,6 +107,7 @@ export namespace Npm {
         binLinks: true,
         progress: false,
         savePrefix: "",
+        ignoreScripts: true,
       })
       await arb.reify().catch(() => {})
     }