Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@irene actually they were inside a provider which was imported somewhere else.
But it is unused for a few months now.
So a dead import kept the compiler and the optimizer away π -
-
Root825387y@irene with a minifier, definitely.
But ES5 ("vanilla js") is more verbose than ES6, so without it the size often increases! -
Root825387y@irene Oh. The transpiler doesn't check code paths to see what's reached and what isn't (or if it's functional). It just transpires everything you throw at it.
-
Root825387y@irene this is an ideal starting place for a rant about how terrible web development really is compared to systems development / embedded systems / game design / literally anything else. π§
-
@irene @root actually... Put "module" in your sentence and it'll be accurate. If properly set up, ts will only transpile the files in your dependency tree.
If you require a file, it'll transpile the whole thing and leave alone the ones you don't.
Getting parts of it, is what's called tree shaking and that's your build tool's job (webpack) -
Root825387y@HeiLian well yes. But what I was explaining to @irene is that it'll add included-but-not-used code to the build. That's why OPs build shrank so much.
-
Root825387y@irene π I used to, too.
And "code" for interpreted languages instead of "script" -- guess I've gotten over that. -
@irene sure... Which word would you use instead? Building doesn't imply nor mean compiling
Related Rants
My coworker complained about an way to big Angular build (20 MB in prod!).
We looked over his code.
... Well deleting that 200 unused base64 encoded images shrinked it down to 500kB
DELETE the Code you replace
rant
angular
optimization