DEV Community

Discussion on: How to use Highlight.js on a Next.js site

 
chrysillala profile image
ChrysillaM

The short answer would be yes. However, you could also import common subset of languages predefined by highlight.js using this syntax

import hljs from 'highlight.js/lib/common';
Enter fullscreen mode Exit fullscreen mode

So you won't need to import each language but this might result in bigger bundle size, compared with importing only the languages you need.