Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev SSR loader should track CSS dependencies #275

Closed
Rich-Harris opened this issue Dec 15, 2020 · 2 comments
Closed

Dev SSR loader should track CSS dependencies #275

Rich-Harris opened this issue Dec 15, 2020 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@Rich-Harris
Copy link
Member

At present, the dev server inlines 'critical' CSS which basically means this:

const rendered = options.root.render(props);

// ...
const styles = `<style>${rendered.css.code}</style>`

Leaving aside the lack of sourcemaps here, this doesn't totally work, because it only includes Svelte's own CSS. It doesn't include anything that was manually imported.

The dev loader just ignores CSS files altogether, but it could instead gather up those dependencies and report back

@Rich-Harris Rich-Harris added bug Something isn't working pkg:kit labels Dec 15, 2020
@Rich-Harris Rich-Harris added this to the 1.0 milestone Dec 15, 2020
@Rich-Harris
Copy link
Member Author

Turns out external CSS files also fail in build, during the optimisation step. Currently blocked by this so working on it

Rich-Harris added a commit that referenced this issue Dec 16, 2020
Rich-Harris pushed a commit that referenced this issue Dec 16, 2020
* failing test for #275

* revert to streaming logs, it's just simpler

* fix test

* simplify/fix css dependencies in prod

* fix imported styles in dev

* smarter css extraction

* add changeset

* lint

* fix explicitly imported CSS in AMP/dev

* prettier, you are testing my patience
@Rich-Harris
Copy link
Member Author

fixed by #279 and #286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant