minidocs icon indicating copy to clipboard operation
minidocs copied to clipboard

Big Bundle Size from highlight.js

Open joehand opened this issue 9 years ago • 3 comments
trafficstars

The bundle size right now is 1.4MB, 581 KB gzipped, for a fairly simple docs site (docs.dat-data.com). It looks like most of that is because all of the 175 (very obscure) highlight.js languages are included in the bundle.

Can we remove the non-common language highlights from the bundle?

Or if not, can we add an option to output a static site without the bundle? For a small static docs site, it doesn't seem like client side routing is worth such a large initial download. I'd rather just have static html.

joehand avatar Jul 06 '16 17:07 joehand

Wow, that is way too big! I'll check it out.

sethvincent avatar Jul 06 '16 17:07 sethvincent

What if you do markdown/highlight parsing on the server and put the HTML in the bundle? That will allow you to remove all the highlight.js and markdown libraries from the bundle.

joehand avatar Jul 06 '16 17:07 joehand

Yeah wow, thanks for flagging @joehand ! In the very short term, we should definitely at least remove most the non-common language highlights. And I also like the more general solution for moving forward.

freeman-lab avatar Jul 08 '16 01:07 freeman-lab