Skip to content

simenforris/astro-duplicate-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

astro-duplicate-css

Minimal Astro + Vue project for reproducing an issue with duplicate CSS when importing components from a component library in different ways.

Summary

  • Astro creates a client-side and server-side css bundle (not sure that makes any sense 🤔)
    • no client directives -> only server-side css bundle
    • client:only="..." -> separate chunks for client komponents
    • client:load (hybrid rendering) -> css included in both server and client bundles
  • Components imported using barrel imports cause css of all components in the barrel to be included in both server and client bundles, even if only one of them is used with a client directive.
  • Component library / monorepo is not really relevant
  • TL;DR: Barrel imports are still bad 🤷‍♂️

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •