Created
January 10, 2018 09:51
-
-
Save markusbergh/aae07f8720ea8da5a4b2ae526ea2280b to your computer and use it in GitHub Desktop.
Highlight.js with tree shaking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Core import | |
import highlightjs from 'highlight.js/lib/highlight' | |
// Languages import | |
import javascript from 'highlight.js/lib/languages/javascript' | |
import bash from 'highlight.js/lib/languages/bash' | |
import yaml from 'highlight.js/lib/languages/yaml' | |
// Register languages | |
highlightjs.registerLanguage('javascript', javascript) | |
highlightjs.registerLanguage('bash', bash) | |
highlightjs.registerLanguage('yaml', yaml) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Beautiful! This worked wonders!