vue-plotly icon indicating copy to clipboard operation
vue-plotly copied to clipboard

How to reduce size by using plotly bundles

Open Vallo opened this issue 7 years ago • 2 comments

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.

Vallo avatar Oct 30 '18 18:10 Vallo

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.

mokkabonna avatar Apr 24 '19 11:04 mokkabonna

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'
      }

wald-tq avatar Oct 24 '19 08:10 wald-tq