bullet-train-co / bullet_train

The Open Source Ruby on Rails SaaS Template
MIT License
1.62k stars 251 forks source link

CSS minification #1428

Open julianrubisch opened 4 months ago

julianrubisch commented 4 months ago

I was scrolling through the Lighthouse audit of my app when I noticed this:

image

Though it's not a ton, it's easily fixed by just adding --minify here: https://github.com/bullet-train-co/bullet_train/blob/main/package.json#L39-L40

I wonder if it's worth upstreaming this to the starter repo? "pretty printing" the CSS in the browser's devtools still makes it easily inspectable.

Or we could add an environment variable, e.g. MINIFY_CSS to switch it on/off?

jagthedrummer commented 4 months ago

Oh, that's interesting. I do think we should figure out how to get --minify to be the default for production. Or maybe make it always the default and use an ENV var to skip minification? SKIP_MINIFY_CSS or something?

julianrubisch commented 4 months ago

Yep. ~~Though to be honest, it seems the bulk of minification could be earned on the theme. ~~

Disregard, I misremembered that. I'll investigate