HNHacker News
TopNewBestAskShowJobs

bigjoemuffaraw

3 karma · joined August 1, 2022

submissionscomments
bigjoemuffaraw··on What's TypeScript compiling? Use a treemap to find out
I think when javascript is used to build html styles you end up with lots of files full of strings and boilerplate. I noticed a similar thing when I was using pixi.js for a small 3d scene. The build output was dominated by massive strings containing all of the shader code. I think once you decide on a style for your project its a good time to fork these libraries and tear out everything you aren't using.
bigjoemuffaraw··on What's TypeScript compiling? Use a treemap to find out
In projects where the node_modules folder starts to get out of hand, I set `"skipLibCheck": true,` in the compilerOptions of my tsconfig file (at least for dev builds).

In my understanding, it skips type-checking any d.ts files (which most packages include by now) which dramatically lowers compile time. In the authors case it looks like their project is about 400kb of their own code and then 30mb of node_modules libraries.

I think it also skips your own d.ts files (it isn't limited to node_modules), so this might just be a way to dramatically speed up your footgun. I have literally never written my own d.ts file though so it works for my purposes