Skip to main content

One post tagged with "Prism"

View All Tags

· 3 min read
Roger Jiang

In this series, we continue to fix the poorly optimized client js bundles that are needlessly large and significantly add to total blocking time.

I discovered a quirk with prism-react-renderer, where if you do not add to the optional languages config - there is apparently no code-splitting for the base language support - and it ends up injecting every language it supports (regardless of whether it appears in your site) into the final production bundle. Just search for "fuck" in your bundle - and if "brainfuck" exists - you know you got the same problem!

TL;DR - You must add ONE valid prism.languages:string[] to themeConfig (EVEN if you don't need it!)