remarkablemark/html-react-parser

Importing the lib with a very large size

Closed this issue · 2 comments

Question

I use an import size analyzer in my IDE and I found that the lib itself has a very large size.

I tried to import each function individually, but it doesn't seem to change the size of the import, in fact the change is minimal.

What could be being imported under the table that is this big?

This is a problem for me, as the page that uses the lib is very heavy.

Captura de tela de 2024-01-28 18-16-01

I'm not sure how you've set up your bundler (e.g., Webpack), but make sure that it's respecting the browser option.

Under the hood, this library uses html-dom-parser, which loads a different DOM parser depending on the environment (browser vs Node.js).

The browser bundle is much smaller than the Node.js bundle since the browser has a native DOM whereas the server does not.

Closing issue due to inactivity