Reduce Prism.js bundle size by removing unused languages - #874
Amrit-raj50 wants to merge 1 commit into
Conversation
It would be nice if this was a bit more explicit and told which languages and plugins are stripped out. Also I am not sure it's such a good idea to remove languages. Because, even if that didn't happen yet, we might still one day need to highlight code using one of the stripped out languages. I think it could be justified if the size savings are big, but neither the description nor the commit message say how much we save by removing languages and how much we save by removing plugins. Maybe removing only plugins would bring most of the size savings? Also now that #873 is merged, in "CONTRIBUTING.md" we say: so I think this PR should remove the languages that it strips out from the supported languages in that sentence. So yeah (contrary to what I suggested before) it should touch "CONTRIBUTING.md" a bit (if it removes languages), but just to change that sentence. @sivaraam also please take a look. |
|
I would suggest first sending a PR that:
Then, after that first PR has been dealt with, we will be in a better position to determine whether a follow-up PR (to remove a few languages that we are very unlikely to use) is valuable. |
This PR optimizes
script/prism.jsby stripping out languages and plugins that aren't used across the site, helping reduce the bundle size.Replaces and supersedes #865 from a clean branch off upstream/master with a single commit, as suggested by @chriscool.