sapper icon indicating copy to clipboard operation
sapper copied to clipboard

Start with 'seen' set from copied static assets

Open jormaj opened this issue 5 years ago • 5 comments

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) :)

jormaj avatar Aug 30 '19 20:08 jormaj

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 :)

jormaj avatar Sep 01 '19 11:09 jormaj

oh this is very clever! altho i dont think we crawl non html assets anyway?

swyxio avatar Sep 14 '19 16:09 swyxio

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 :)

jormaj avatar Sep 14 '19 21:09 jormaj

https://github.com/sveltejs/sapper/pull/1105 / https://github.com/sveltejs/sapper/pull/938 look potentially related

benmccann avatar May 25 '20 03:05 benmccann

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?

benmccann avatar Mar 25 '21 21:03 benmccann

SvelteKit 1.0 is now out and Sapper is deprecated, so I'm going to close this

benmccann avatar Jan 11 '23 16:01 benmccann