From 38c6ce268c7a41ca2eca8087caf5958d3804c83c Mon Sep 17 00:00:00 2001 From: jimcody1995 Date: Sun, 5 Jul 2026 06:27:56 +0200 Subject: [PATCH] fix(signals): classify .mts and .cts source maps as generated Module TypeScript bundlers emit .mts.map/.cts.map siblings; slop path-matchers already treated .mjs/.cjs maps as generated but not these spellings, so they were miscounted as substantive source. Co-authored-by: Cursor --- src/signals/path-matchers.ts | 2 +- test/unit/path-matchers.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/signals/path-matchers.ts b/src/signals/path-matchers.ts index 9a5c17951c..44f8f47a23 100644 --- a/src/signals/path-matchers.ts +++ b/src/signals/path-matchers.ts @@ -65,7 +65,7 @@ function isGeneratedFileFrom(parts: NormalizedPath): boolean { // Source maps for every first-class JS/TS bundle extension. `.mjs`/`.cjs` are already // recognized code extensions (isCodeFile), so their bundlers' `.mjs.map` / `.cjs.map` // maps are generated output too — the same as `.js.map`. - /\.(js|jsx|mjs|cjs|ts|tsx|css)\.map$/.test(norm) || + /\.(js|jsx|mjs|cjs|ts|tsx|mts|cts|css)\.map$/.test(norm) || base === "worker-configuration.d.ts" ); } diff --git a/test/unit/path-matchers.test.ts b/test/unit/path-matchers.test.ts index 0b728d6e70..f55905ccf4 100644 --- a/test/unit/path-matchers.test.ts +++ b/test/unit/path-matchers.test.ts @@ -41,7 +41,7 @@ describe("isGeneratedFile", () => { it("matches source maps for every first-class JS/TS bundle extension", () => { // `.mjs`/`.cjs` are recognized code extensions (isCodeFile), so their bundlers' source // maps are generated output too — the same as `.js.map` / `.tsx.map`. - for (const path of ["dist/bundle.mjs.map", "dist/bundle.cjs.map", "lib/index.jsx.map"]) { + for (const path of ["dist/bundle.mjs.map", "dist/bundle.cjs.map", "lib/index.jsx.map", "dist/loader.mts.map", "dist/setup.cts.map"]) { expect(isGeneratedFile(path)).toBe(true); } });