mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-19 05:45:27 +00:00
Don't preload .map files
This commit is contained in:
@@ -149,6 +149,7 @@ function get_route_handler(chunks: Record<string, string>, routes: RouteObject[]
|
|||||||
// TODO detect other stuff we can preload? images, CSS, fonts?
|
// TODO detect other stuff we can preload? images, CSS, fonts?
|
||||||
const link = []
|
const link = []
|
||||||
.concat(chunks.main, chunks[route.id])
|
.concat(chunks.main, chunks[route.id])
|
||||||
|
.filter(file => !file.match(/\.map$/))
|
||||||
.map(file => `<${req.baseUrl}/client/${file}>;rel="preload";as="script"`)
|
.map(file => `<${req.baseUrl}/client/${file}>;rel="preload";as="script"`)
|
||||||
.join(', ');
|
.join(', ');
|
||||||
|
|
||||||
@@ -198,7 +199,7 @@ function get_route_handler(chunks: Record<string, string>, routes: RouteObject[]
|
|||||||
|
|
||||||
let scripts = []
|
let scripts = []
|
||||||
.concat(chunks.main) // chunks main might be an array. it might not! thanks, webpack
|
.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 => `<script src='${req.baseUrl}/client/${file}'></script>`)
|
.map(file => `<script src='${req.baseUrl}/client/${file}'></script>`)
|
||||||
.join('');
|
.join('');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user