Skip to content

[fullstack] deduplicate client and server css on build #1244

@hi-ogawa

Description

@hi-ogawa

Currently css imported by universal module are processed by both builds. Css from server build is copied to client build.

Ideally, css imported on server module graph can be intercepted and move it as client build entry (similar to current dynamic client entry or rsc client reference). In this way, css processing and code splitting is centralized on client build and it would be probably more predictable.

To be investigated

  • How about css module? Might need to track it back class names between two builds?
  • How about build-time css framework (e.g. vanilla-extract)? it might need processing to happen where it's imported as it works based on code usage.

Either way, it's worth exploring this approach and add an ability to enable it as opt-in/out.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions