From 6b2d418973bb1bbb06a7a8e7bf4f7558a86790d2 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 14 Apr 2026 18:01:29 +0100 Subject: [PATCH] fix(channels): resolve bundled plugin mts candidates --- src/channels/plugins/module-loader.test.ts | 4 +++- src/channels/plugins/module-loader.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/channels/plugins/module-loader.test.ts b/src/channels/plugins/module-loader.test.ts index 0487eac5f83..e895e9859c7 100644 --- a/src/channels/plugins/module-loader.test.ts +++ b/src/channels/plugins/module-loader.test.ts @@ -46,15 +46,17 @@ describe("channel plugin module loader helpers", () => { it("resolves plugin module candidates and picks the first existing extension", () => { const rootDir = createTempDir(); - const expectedPath = path.join(rootDir, "src", "checker.mjs"); + const expectedPath = path.join(rootDir, "src", "checker.mts"); fs.mkdirSync(path.dirname(expectedPath), { recursive: true }); fs.writeFileSync(expectedPath, "export const ok = true;\n", "utf8"); expect(resolvePluginModuleCandidates(rootDir, "./src/checker")).toEqual([ path.join(rootDir, "src", "checker"), path.join(rootDir, "src", "checker.ts"), + path.join(rootDir, "src", "checker.mts"), path.join(rootDir, "src", "checker.js"), path.join(rootDir, "src", "checker.mjs"), + path.join(rootDir, "src", "checker.cts"), path.join(rootDir, "src", "checker.cjs"), ]); expect(resolveExistingPluginModulePath(rootDir, "./src/checker")).toBe(expectedPath); diff --git a/src/channels/plugins/module-loader.ts b/src/channels/plugins/module-loader.ts index f54388679ce..9fe38f634a8 100644 --- a/src/channels/plugins/module-loader.ts +++ b/src/channels/plugins/module-loader.ts @@ -53,8 +53,10 @@ export function resolvePluginModuleCandidates(rootDir: string, specifier: string return [ resolvedPath, `${resolvedPath}.ts`, + `${resolvedPath}.mts`, `${resolvedPath}.js`, `${resolvedPath}.mjs`, + `${resolvedPath}.cts`, `${resolvedPath}.cjs`, ]; }