DEV Community

Discussion on: Next.Js boilerplate with TailwindCSS and SASS

Collapse
 
jsardev profile image
Jakub Sarnowski

Cool! But what about optimizing the CSS chunk? Right now you will serve the same large CSS chunk on every page. Even if a lot of CSS are not even used. AFAIK it's not easy to set this up with NextJS. Would love to see a continuation :)

Collapse
 
vguleaev profile image
Vladislav Guleaev

Good question

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

Thankyou @sarneeh for the comment. For TailwindCSS we can use [purgecss (tailwindcss.com/docs/controlling-f... "purgecss") for controlling the file size. But besides that, I am researching on the optimizing the CSS chunk. And for sure I will let you know if I will get proper results. :)

Collapse
 
jsardev profile image
Jakub Sarnowski

I know about PurgeCSS. The problem is that it didn't work for me with NextJS. But I tried it like a year ago, so it could improve since then.