vue-plotly
vue-plotly copied to clipboard
How to reduce size by using plotly bundles
Is there a way to reduce this wrapper size by only importing the needed dependencies or bundles?
such as Plotly Basic
EDIT: Managed to implement it by directly editing the wrapper.
At Plotly.vue changed
import Plotly from 'plotly.js'
to
import Plotly from 'plotly.js-basic-dist'
and at vue-plotly.js changed every reference to plotly.js to plotly.js-basic-dist
but I think there should be a correct way to implement this feature.
It would be nice yes, not sure how to implement it though...
Maybe build several bundles, each containing different plotly bundles.
Any help is welcomed.
plotly.js is used as external in vue-plotly. If you use vue-plotly in a project your own bundler is looking for plotly.js.
So you can configure to resove plotly.js as you want in your own project. For example with webpack you can do:
webpack.config.js:
resolve: {
alias: {
'plotly.js': 'plotly.js/dist/plotly-basic.js'
}