mandrasch / ddev-craftcms-vite

Demo repository for CraftCMS + DDEV + vite, including support for GitHub codespaces.
Creative Commons Zero v1.0 Universal
9 stars 0 forks source link

Disable critical CSS in craft.vite.script() function #9

Closed phil-cv closed 1 month ago

phil-cv commented 3 months ago

Because the project doesn't implements critical CSS (and no compelling reason to), the craft.vite.script() function should include false as a second parameter to ensure CSS doesn't load asynchronously and cause a flash of unstyled content:

{{ craft.vite.script("src/js/app.js", false) }}

See https://nystudio107.com/docs/vite/#using-vite for details.

mandrasch commented 3 months ago

Hi! Oh wow, thanks very much for reporting! 💡