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

Fixed %sapper.styles% injection for webpack apps #622

Merged
merged 2 commits into from
Apr 21, 2019
Merged

Fixed %sapper.styles% injection for webpack apps #622

merged 2 commits into from
Apr 21, 2019

Conversation

artemjackson
Copy link
Contributor

@artemjackson artemjackson commented Apr 8, 2019

Hi again!

Several month ago I've added css field to build.json info file for webpack apps.
The css field had a shape like:

{
  main: string,
  chunks: Record<WebpackChunkName, CSSFileName>
}

That time I didn't notice two things:

  1. Page part styles are retrieved via build_info.css[part.file]. Because of the implementation described above used the wepackChunkName to form ccs.chunks keys the styles were never added to %sapper.styles%.
  2. The css.chunks values should be arrays not strings

The PR fixes both of the issues described.

@artemjackson
Copy link
Contributor Author

artemjackson commented Apr 8, 2019

Btw, I tested the PR against sapper@0.24.3.

Will it be possible to use the fix with sapper version lower the 0.26-alpha (to not to migrate to svelte 3)?

Rich-Harris added a commit that referenced this pull request Apr 21, 2019
@Rich-Harris Rich-Harris merged commit f9d1dc5 into sveltejs:master Apr 21, 2019
@Rich-Harris
Copy link
Member

Sorry for the delay, Sapper has been a big neglected during the Svelte 3 release. I also published a 0.25.1 version with just this fix. Thanks!

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