I'm trying to use Prism.js syntax highlighter client-side as an npm
dependency, instead of loading it from <script src="...">
tags. Here is the Prism reference in package.json
{
"dependencies": {
"prismjs": "^1.5.1"
}
}
And the way I'm trying to use it in my code
import Prism from 'prismjs'
Prism.highlightAll();
This produces the following results:
- Tokenizing works for basic languages (html, javascript...)
- Tokenizing does not work for other specific languages (lua, handlebars...)
- For all languages, syntax coloring isn't applied (css file doesn't seem loaded)
So I'm wondering
- Are there other language-specific packages (like prismjs-handlebars for instance)?
- Are there theme-specific packages (like prism-okaidia for instance) which would import the css?
--
TL;DR
How to load/use Prism.js client-side from npm
instead of from script tags?