nerijusgood nerijusgood - 2 years ago 114
Javascript Question

Code highlighting js that would work with Browserify?

I am looking for a code highlighter that would support main coding languages (sass/scss also) and would work nicely with Browserify.

At the moment I was using prismjs, it works just nice (as highlighter), but I cannot seem to make it work with Browserify. Recently, I started using Browserify (which is awesome) and works fine with all scripts and modules, except highlighter (which I need).

Is there a good code highlighter that works fluently with Browserify without major hacking? :)

Thanks in advance.

Answer Source

Prismjs works now seamlessly with browserify.

const Prism = require('prismjs');

This would basically do the same as using the script tag version.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download