You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, next-yak extracts CSS from tagged template literals through our SWC plugin, which adds CSS as comments in the output JS file. A custom webpack loader then extracts these comments and processes them through the CSS module system. This works but relies on webpack-specific syntax (!=!) and a complex extraction mechanism.
Turbopack is planning to support CSS modules via direct data URL imports. We should investigate replacing the comment extraction approach with data URL imports to simplify our architecture and prepare for Turbopack compatibility:
This would eliminate our custom comment serialization and parsing steps, use standard module loading, and align with Turbopack's architecture. So the SWC plugin would generate these imports directly with one single compile step
Some important considerations:
Our cross-file dependency resolution would need reworking
Data URL encoding must properly handle CSS escaping
We need to verify Next.js's CSS module system works with this approach
This might solve #112 and could help us in future as this format is supported by webpack turbopack rspack and vite
The text was updated successfully, but these errors were encountered:
Currently, next-yak extracts CSS from tagged template literals through our SWC plugin, which adds CSS as comments in the output JS file. A custom webpack loader then extracts these comments and processes them through the CSS module system. This works but relies on webpack-specific syntax (
!=!
) and a complex extraction mechanism.Turbopack is planning to support CSS modules via direct data URL imports. We should investigate replacing the comment extraction approach with data URL imports to simplify our architecture and prepare for Turbopack compatibility:
Instead of generating:
We would generate:
This would eliminate our custom comment serialization and parsing steps, use standard module loading, and align with Turbopack's architecture. So the SWC plugin would generate these imports directly with one single compile step
Some important considerations:
This might solve #112 and could help us in future as this format is supported by webpack turbopack rspack and vite
The text was updated successfully, but these errors were encountered: