Is there a way to only load certain languages? Bundle size is large
Hi, react-code-blocks is very nice! However, it would be useful if there was a way to only load the required languages, as currently the bundle is very large and in most cases will be loading many more languages than the client likely needs.
Hey @jacobedawson, that's an interesting point you bring up. Currently, the languages are called using the PrismAsyncLight component offered by react-syntax-highlighter which should optimize the build size.
But the availability of languages might be a reason for the large package size.
Perhaps we can split the packages into a light version that would require the language to be a peer dependency?
I'm open to suggestions here
Yeah, I'm using react-syntax-highlighter and I'm able to require only the languages that I need, I think it makes sense since there are a lot of language files that will never be used.
I second the request for a 'light' version with a way to select only the languages needed. I wanted a quick option for some JS highlighting and while the display looks great, my chunked build went from 10 files to 310.
Just wanted to bump this issue. 💯 would be great to have a light build option.
The prod build creates hundreds of react-syntax-highlighter_languages*.chunk.js files even though it's only using the React highlighter.