Skip to content

Commit bb23224

Browse files
authored
Fix ESM imports for @opencode-ai/plugin (anomalyco#16916)
1 parent 94c128f commit bb23224

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/plugin/src/example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Plugin } from "./index"
2-
import { tool } from "./tool"
1+
import { Plugin } from "./index.js"
2+
import { tool } from "./tool.js"
33

44
export const ExamplePlugin: Plugin = async (ctx) => {
55
return {

packages/plugin/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import type {
1212
Config,
1313
} from "@opencode-ai/sdk"
1414

15-
import type { BunShell } from "./shell"
16-
import { type ToolDefinition } from "./tool"
15+
import type { BunShell } from "./shell.js"
16+
import { type ToolDefinition } from "./tool.js"
1717

18-
export * from "./tool"
18+
export * from "./tool.js"
1919

2020
export type ProviderContext = {
2121
source: "env" | "config" | "custom" | "api"

packages/plugin/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"extends": "@tsconfig/node22/tsconfig.json",
44
"compilerOptions": {
55
"outDir": "dist",
6-
"module": "preserve",
6+
"module": "nodenext",
77
"declaration": true,
8-
"moduleResolution": "bundler",
8+
"moduleResolution": "nodenext",
99
"lib": ["es2022", "dom", "dom.iterable"]
1010
},
1111
"include": ["src"]

0 commit comments

Comments
 (0)