DEV Community

Discussion on: [Update] Using Svelte with Tailwindcss - A better approach

Collapse
 
pgvr profile image
Patrick Göler von Ravensburg

Thanks for sharing. I ran into a small issue where the production flag in the postcss config is always false and therefore purgecss is not invoked. The NODE_ENV is "development" even when running npm run build in my case. I am on windows and I am resolving this by changing the build script to set NODE_ENV=production && sapper build --legacy. With that purgecss is invoked and everything is fabulous, thanks again.

Collapse
 
sarioglu profile image
sarioglu

Same for me too. I didn't mention that because I couldn't find any official information whether it is an expected behavior or not. Thank you for mentioning.

Collapse
 
fillipvt profile image
fillipvt

This still happens even though I'm using set NODE_ENV=production && sapper export --legacy I find this super weird. Not sure what to do at all.

The only way for me to avoid having all the classes in production is to use purgecss in both dev and prod. What a bummer

Thread Thread
 
danawoodman profile image
Dana Woodman

What about?

NODE_ENV=production sapper export --legacy