How to modularize react-plotly.js?

The main plotly.js repo goes to great length about how to modularise the plotly code and avoid having the huge bundle with Mapbox, etc.

This library seems to be the official “basis of Plotly’s React component suite”, yet it’s just loading the full plotly.js code.

This makes the bundle super big, Webpack super slow, and the minification time skyrocket as the codebase is simply just huge.

Since there is a whole article about modularizing plotly, it’s strange to me that this lib requires the full build.

What is the best way to use react-plotly with a more minimal plotly bundle?

// I also opened an issue here: