Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

include css depended upon by entry point, even if also depended on by a lazily-loaded component #471

Merged
merged 2 commits into from
Oct 16, 2018

Conversation

Rich-Harris
Copy link
Member

This fixes a bug whereby CSS depended upon by the entry point (which statically depends on src/routes/_layout.html if it exists, along with src/routes/index.html and src/routes/_error.html) would be omitted if it is also depended upon by a lazily-loaded chunk.

The code is a bit woolly, and it could use some tests, so I'm just going to leave it here for the moment

@arggh
Copy link

arggh commented Oct 13, 2018

I tried running Sapper from missing-css branch, which caused almost all CSS styles to disappear, but not all. At a glance it seems like styles used on multiple routes, such as the nav, are shipped.

@Rich-Harris
Copy link
Member Author

@arggh huh. that's with latest Rollup etc?

@Rich-Harris
Copy link
Member Author

oh, wait, I forgot I ran into a similar thing earlier today — d'oh. Can you try again please?

@arggh
Copy link

arggh commented Oct 16, 2018

@Rich-Harris Works now!

@Rich-Harris Rich-Harris merged commit 4fe8df3 into master Oct 16, 2018
@Rich-Harris Rich-Harris deleted the missing-css branch October 16, 2018 12:38
@Rich-Harris
Copy link
Member Author

Oddly enough I couldn't quite figure out how to make a failing test for this, even though I managed to reproduce the bug in a separate project. Rather than wrestle with it all day I've released 0.23.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants