I am building a react app using plotly and it’s working fine.
But at 2.2 mb, the plotly min file is huge.
To reduce the bundle size, I followed the modularising documentation in the following
This is what I have done so far…
Downloaded the 1.5 zip file and unpacked in my assets
Added the following code
import * as PlotlyCore from '…/plotly.js/lib/core’
import * as PlotlyHistogram from '…/plotly.js/lib/histogram’
const customPlotly = PlotlyCore.register(PlotlyHistogram)
After all this customPlotly is still undefined.
I console logged PlotlyCore and PlotlyHistogram and they look as they should.
Am I missing something here?
Help much appreciate. Thanks