hey wait

if you gzip everything anyhow, why do you ever need to do minification? it doesn't look like you save very much by doing it

@KitRedgrave It's still smaller if you do it right (reuse the same identifier in different scopes, make certain things more consistent, and they'll compress better), but tree shaking is where the real benefit comes in: removing code you wrote or included, but didn't use, especially an issue when using libraries.

(Yes, I know some people are too cool for libraries, and if it works for them, cool, but I use them judiciously to save time for things I prefer to do.)

@aschmitz oh yeah, tbh i was thinking implicitly of code shaking already being done.

and linking to minified libraries is alright, since those aren't the code of interest

@aschmitz though i guess then you'd have to do symbol mapping in your code for the latter, which nobody does and so your own code would be half-minified anyway if you did that lol


@KitRedgrave Ah, no, I meant that you'd include the libraries in your code for minification, then tree shake the whole thing. Saves you from sending parts of the libraries you don't use. (And in general if you're at the point of counting bytes, you really shouldn't be using libraries from another server/file. The added latency is significant unless your page is *huge*.)

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!