I recently started using parcelJS to build and I'm pretty new to Webpack and such tools. I use the highlighJS library to highlight some syntax on my page and I'm importing it using the line below.
import hljs from 'highlight.js/lib/highlight';
This library also has languages that to highlight the syntax which can be imported using:
import python from 'highlight.js/lib/languages/python';
Is there a way to import all of the languages in the folder instead of importing them one by one?
Using
import hljs from 'highlight.js'
imports all the languages and functions in highlightJS when usinghljs.highlightBlock(vnode.dom);
syntax is automatically detected and highlighted and there is no need to register a language.