diff --git a/src/middleware.ts b/src/middleware.ts index 8f0f06e..8e87da1 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -149,6 +149,7 @@ function get_route_handler(chunks: Record, routes: RouteObject[] // TODO detect other stuff we can preload? images, CSS, fonts? const link = [] .concat(chunks.main, chunks[route.id]) + .filter(file => !file.match(/\.map$/)) .map(file => `<${req.baseUrl}/client/${file}>;rel="preload";as="script"`) .join(', '); @@ -198,7 +199,7 @@ function get_route_handler(chunks: Record, routes: RouteObject[] let scripts = [] .concat(chunks.main) // chunks main might be an array. it might not! thanks, webpack - .filter(function (file) { return !file.match(/\.map$/); }) + .filter(file => !file.match(/\.map$/)) .map(file => ``) .join('');