I recently updated the Code Block documentation to cover how to install only select languages for Highlight.js. This is now the default recommendation. View it here:
The import statement now uses the "core" version: import hljs from 'highlight.js/lib/core';
A number of common web (or adjacent) languages are imported by default
Each imported language must be registered via hljs.registerLanguage()
Additionally if using the PurgeCSS plugin, addition configuration is need in vite.config.ts
It's a lot of boilerplate, but should reduce in a GREATLY reduced bundle size over the previous defaults. Given this, I think we're good to reintroduce this when you get a chance @niktek
I recently updated the Code Block documentation to cover how to install only select languages for Highlight.js. This is now the default recommendation. View it here:
https://www.skeleton.dev/utilities/codeblocks#configure-your-project
This includes the following changes:
import hljs from 'highlight.js/lib/core';
hljs.registerLanguage()
vite.config.ts
It's a lot of boilerplate, but should reduce in a GREATLY reduced bundle size over the previous defaults. Given this, I think we're good to reintroduce this when you get a chance @niktek
Thanks!