mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 14:25:07 +00:00
fix error pages
This commit is contained in:
@@ -262,9 +262,12 @@ function get_page_handler(routes: RouteObject, store_getter: (req: Req) => Store
|
|||||||
// preload main.js and current route
|
// preload main.js and current route
|
||||||
// TODO detect other stuff we can preload? images, CSS, fonts?
|
// TODO detect other stuff we can preload? images, CSS, fonts?
|
||||||
let preloaded_chunks = Array.isArray(chunks.main) ? chunks.main : [chunks.main];
|
let preloaded_chunks = Array.isArray(chunks.main) ? chunks.main : [chunks.main];
|
||||||
page.parts.forEach(part => {
|
if (!error) {
|
||||||
preloaded_chunks = preloaded_chunks.concat(chunks[part.name]); // using concat because it could be a string or an array. thanks webpack!
|
page.parts.forEach(part => {
|
||||||
});
|
// using concat because it could be a string or an array. thanks webpack!
|
||||||
|
preloaded_chunks = preloaded_chunks.concat(chunks[part.name]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const link = preloaded_chunks
|
const link = preloaded_chunks
|
||||||
.filter(file => !file.match(/\.map$/))
|
.filter(file => !file.match(/\.map$/))
|
||||||
|
|||||||
Reference in New Issue
Block a user