Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): directly import Light syntax highlighter to avoid side effects and limit the number of languages bundled #127

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

scurker
Copy link
Member

@scurker scurker commented Nov 23, 2020

It looks like the default recommendation for react-syntax-highlighter to create a light build is still importing all of the languages, greatly increasing the bundle size:

before webpack bundle (~1mb)

webpack bundle analyzer results for webpack build

Directly importing the Light module should greatly reduce the size and avoid side effects.

…fects and limit the number of languages bundled
@scurker scurker requested review from schne324 and a team November 23, 2020 16:55
@scurker scurker merged commit 7af84f8 into develop Nov 23, 2020
@scurker scurker deleted the smaller-code-imports branch November 23, 2020 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants