Browse Source

fix: mark jsdom as external to prevent worker path resolution error (#311)

Bun was bundling jsdom and hardcoding an absolute path to xhr-sync-worker.js
into dist/index.js, which breaks when the plugin is loaded from OpenCode's
cache on a different machine. By marking jsdom as external, the built plugin
imports jsdom normally instead of embedding that absolute worker path.

Fixes #311
Alvin Real 3 months ago
parent
commit
d652c46f40
1 changed files with 2 additions and 2 deletions
  1. 2 2
      package.json

+ 2 - 2
package.json

@@ -36,8 +36,8 @@
     "LICENSE"
   ],
   "scripts": {
-    "build:plugin": "bun build src/index.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk",
-    "build:cli": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk",
+    "build:plugin": "bun build src/index.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom",
+    "build:cli": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom",
     "build": "bun run build:plugin && bun run build:cli && tsc --emitDeclarationOnly && bun run generate-schema",
     "prepare": "bun run build",
     "contributors:add": "all-contributors add",