Skip to content

Code split CSS chunks#724

Closed
itsdouges wants to merge 6 commits intomasterfrom
css-chunks
Closed

Code split CSS chunks#724
itsdouges wants to merge 6 commits intomasterfrom
css-chunks

Conversation

@itsdouges
Copy link
Contributor

@itsdouges itsdouges commented Apr 11, 2021

Closes #722

Seems to work, need to think about edge cases. As well as what happens with multiple entry points. This might also closes #669 as we remove the need for placing everything into a single style sheet via cache groups.

@jantimon how's this look?

Changes

  • Compiled now supports async CSS chunks
  • To enable this Compiled now takes control over the entire CSS pipeline
  • Any CSS declared inside or outside of Compiled will be sorted and potentially hoisted if unsafe for atomic styles

TODO

  • Investigate potential edge cases & side effects
  • Update docs to talk through how Compiled will take control of the entire CSS pipeline

@itsdouges itsdouges added the wip 🚧 Work in progress - don't judge too harshly. label Apr 11, 2021
@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2021

🦋 Changeset detected

Latest commit: 0768f8e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@compiled/webpack-loader Minor
@compiled/css Minor
@compiled/babel-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudkite
Copy link

Nice work!! Does this enable multiple entry points? Not sure how common this is in the wild, but our app uses multiple entry points to build bundles for independent apps (website, chrome extension, embed etc) within a monorepo. Being able to only include styles used for a particular entry point would be great!

@itsdouges
Copy link
Contributor Author

Hi! Yeah exactly, need to investigate what happens and probably tweak it 🙂

@itsdouges itsdouges removed the wip 🚧 Work in progress - don't judge too harshly. label Apr 26, 2021
@itsdouges itsdouges marked this pull request as ready for review April 26, 2021 22:43
@itsdouges itsdouges marked this pull request as draft July 11, 2021 03:39
@itsdouges itsdouges removed the request for review from pgmanutd July 11, 2021 03:39
@itsdouges itsdouges added the spike 🏐 Testing something with some throw away code. label Jul 11, 2021
@itsdouges
Copy link
Contributor Author

Closing, this can be used as a reference when picking it up later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spike 🏐 Testing something with some throw away code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NextJS CSS extraction support [Webpack] Code split CSS

2 participants