Skip to content

Commit cf396c3

Browse files
committed
exhibitionist-digital#292 serve build: return 404 on missing .map requests instead of try to render as HTML
1 parent 02d313c commit cf396c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/middleware/serveStatic.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ export const serveStatic = (options: ServeStaticOptions = { root: "" }) => {
6464
* TODO: Maybe we should handle the type of error that fetch would throw?
6565
*/
6666
log.debug(`Static file: ${path} does not exist, continuing`);
67+
68+
if (path.match("\.map$")) {
69+
return new Response(
70+
null,
71+
{ status: 404 },
72+
);
73+
}
74+
6775
await next();
6876
}
6977
};

0 commit comments

Comments
 (0)