remarkjs / react-markdown

Markdown component for React
https://remarkjs.github.io/react-markdown/
MIT License
13.27k stars 876 forks source link

Reduce bundle size #787

Closed eurobob closed 1 year ago

eurobob commented 1 year ago

Initial checklist

Problem

This package is adding 438kb to my rendered bundle size

This was previously brought up around the time of v6.0.0, nearly 3 years ago regarding an increase from 23.5kb to 32.4kb https://github.com/remarkjs/react-markdown/issues/595

438kb seems incredibly excessive, is there any way to optimise this?

Solution

Not sure the specifics, does it need tree shaking?

Alternatives

Unsure

wooorm commented 1 year ago

Change your tools. See the badge in the readme: https://github.com/remarkjs/react-markdown#react-markdown. Within the constraints of the goal of this project (support CM, plugins, useful default options), it isn’t going to get smaller.

github-actions[bot] commented 1 year ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

Murderlon commented 1 year ago

Also good to note that the package is 42.6kB (minified + gzipped). If bundle size is critical, consider server-side rendering your markdown to HTML so you don't have client-side libraries for this.