Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/signals/path-matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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|mts|cts|css)\.map$/.test(norm) ||
/\.(js|jsx|mjs|cjs|ts|tsx|mts|cts|vue|svelte|astro|css)\.map$/.test(norm) ||
base === "worker-configuration.d.ts"
);
}
Expand Down
13 changes: 11 additions & 2 deletions test/unit/path-matchers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ describe("isGeneratedFile", () => {
}
});

it("matches source maps for every first-class JS/TS bundle extension", () => {
it("matches source maps for every first-class JS/TS and front-end framework 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", "dist/loader.mts.map", "dist/setup.cts.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",
"dist/App.vue.map",
"dist/Card.svelte.map",
"dist/page.astro.map",
]) {
expect(isGeneratedFile(path)).toBe(true);
}
});
Expand Down
Loading