2 ms·
Sure, but it's far away from "pulls in over a Megabyte of hundreds of programming language syntax definitions" as you said: 76K node_modules/highlight.
by capableweb 3y ago
Sure, but it's far away from "pulls in over a Megabyte of hundreds of programming language syntax definitions" as you said:
76K node_modules/highlight.js/lib/core.js
20K node_modules/highlight.js/lib/languages/javascript.js
But I agree with you, that you probably want to only load it when really needed, especially if your total budget is 500kb which this would take a big part of it already.
Edit: I see now their budget was actually more than 1MB actually, as they for some reason only "really care" about gzip'd sizes... Then I wouldn't say it's so bad to just say fuck it and do it the easy way. Saves any latency introduced by lazy-loading it too.