Browse Source

fix(plugin): correct exports to point to dist instead of src

The package.json exports were pointing to ./src/*.ts but the published
package only includes the dist/ folder. This caused 'Cannot find module'
errors when custom tools tried to import @opencode-ai/plugin.

Changed exports from:
  ".": "./src/index.ts"
  "./tool": "./src/tool.ts"

To:
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" }
  "./tool": { "types": "./dist/tool.d.ts", "import": "./dist/tool.js" }
R44VC0RP 3 weeks ago
parent
commit
7417e6eb38
1 changed files with 8 additions and 2 deletions
  1. 8 2
      packages/plugin/package.json

+ 8 - 2
packages/plugin/package.json

@@ -9,8 +9,14 @@
     "build": "tsc"
   },
   "exports": {
-    ".": "./src/index.ts",
-    "./tool": "./src/tool.ts"
+    ".": {
+      "types": "./dist/index.d.ts",
+      "import": "./dist/index.js"
+    },
+    "./tool": {
+      "types": "./dist/tool.d.ts",
+      "import": "./dist/tool.js"
+    }
   },
   "files": [
     "dist"