diff --git a/src/signals/path-matchers.ts b/src/signals/path-matchers.ts index c5339e7df6..e1953dbb8c 100644 --- a/src/signals/path-matchers.ts +++ b/src/signals/path-matchers.ts @@ -73,10 +73,10 @@ function isGeneratedFileFrom(parts: NormalizedPath): boolean { /\.(g|freezed|gr)\.dart$/.test(norm) || // C# codegen: WinForms/WPF designer partials (`.designer.cs`) and XAML/T4 output (`.g.cs`). /\.(designer|g)\.cs$/.test(norm) || - // Source maps for bundler/front-end output across JS/TS, frameworks, stylesheets, HTML, and SVG. + // Source maps for bundler/front-end output across JS/TS, frameworks, stylesheets, HTML, SVG, and WASM. // `.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|mts|cts|vue|svelte|astro|mdx|scss|sass|less|html|svg|css)\.map$/.test(norm) || + /\.(js|jsx|mjs|cjs|ts|tsx|mts|cts|vue|svelte|astro|mdx|scss|sass|less|html|svg|css|wasm)\.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 ca29f3545e..8bd49bfc39 100644 --- a/test/unit/path-matchers.test.ts +++ b/test/unit/path-matchers.test.ts @@ -38,7 +38,7 @@ describe("isGeneratedFile", () => { } }); - it("matches source maps for every first-class JS/TS, MDX, HTML, SVG, Sass/SCSS/Less, and front-end framework extension", () => { + it("matches source maps for JS/TS, MDX, HTML, SVG, WASM, Sass/SCSS/Less, and front-end framework extensions", () => { // `.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 [ @@ -56,9 +56,11 @@ describe("isGeneratedFile", () => { "dist/theme.less.map", "dist/index.html.map", "dist/icon.svg.map", + "dist/pkg.wasm.map", ]) { expect(isGeneratedFile(path)).toBe(true); } + expect(classifyChangedFile("dist/pkg.wasm.map")).toBe("generated"); }); it("matches C++ protobuf output alongside the Go/TS/JS plugins", () => { @@ -443,6 +445,7 @@ describe("classifyChangedFile", () => { ["proto/messages.pb.erl", "generated"], ["proto/messages.pb.hrl", "generated"], ["proto/messages.pb.cr", "generated"], + ["dist/pkg.wasm.map", "generated"], ["vendor/lib.go", "vendored"], ["package-lock.json", "lockfile"], ["bun.lock", "lockfile"],