Skip to content

react syntax highlighter

Created: 2020-06-18 14:51:34 -0700 Modified: 2020-06-18 14:53:33 -0700

This is basically the whole reason I’m making this note, and the cause/solution is in my own post in this issue.

In short: in production, tree-shaking will shake out highlightjs’s sub-languages, so if you have HTML with JavaScript inside it, then you need to import and register XML, JavaScript, and potentially CSS if you want that too.