diff --git a/plugin/scripts/package.json b/plugin/scripts/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/plugin/scripts/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/src/__tests__/plugin.test.ts b/src/__tests__/plugin.test.ts index 6187301..349da53 100644 --- a/src/__tests__/plugin.test.ts +++ b/src/__tests__/plugin.test.ts @@ -160,6 +160,15 @@ describe("plugin/.mcp.json", () => { }); }); +describe("plugin/scripts/package.json", () => { + // The plugin cache copies only plugin/, so this file is what makes Node + // load bundle.js as ESM on versions without module syntax detection + // (Node < 20.19 and 22.0-22.6). + it("marks the bundle directory as ESM", () => { + expect(loadJson("plugin/scripts/package.json").type).toBe("module"); + }); +}); + describe("plugin/skills/ (slash commands)", () => { it("skills/setup/SKILL.md exists", () => { expect(existsSync(resolve(ROOT, "plugin/skills/setup/SKILL.md"))).toBe(true);