sapper
sapper copied to clipboard
Start with 'seen' set from copied static assets
I started working on this branch when I noticed that assets in static that were being linked to from a webpage got corrupted when running sapper export
(pdf files in particular).
THEN I noticed that I was on an older version of sapper (0.27.4) and that this issue has been resolved since (ie pdfs appear fine in sapper exports in version 0.27.8)
Still, I think it makes sense to skip crawling files in static
, since those got copied before so no point in going over those again.
Of course happy to get some feedback, still really new in this code base (and js in general) :)
I took another stab at it, and this refactor uses a recursive accumulator. I think this one is the cleanest so far, but happy to hear other opinions :)
oh this is very clever! altho i dont think we crawl non html assets anyway?
oh this is very clever! altho i dont think we crawl non html assets anyway?
Normally, no. But if they're linked to from a page (f.ex. a pdf document in my case), they would be crawled. Hence this PR :)
https://github.com/sveltejs/sapper/pull/1105 / https://github.com/sveltejs/sapper/pull/938 look potentially related
Sorry this had gone unreviewed for so long. It looks like there's a merge conflict here. Maybe it's better to try to make sure SvelteKit works as desired than trying to get it in here at this point?
SvelteKit 1.0 is now out and Sapper is deprecated, so I'm going to close this