Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reduce size by using plotly bundles #14

Open
Vallo opened this issue Oct 30, 2018 · 2 comments
Open

How to reduce size by using plotly bundles #14

Vallo opened this issue Oct 30, 2018 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Vallo
Copy link

Vallo commented Oct 30, 2018

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.

@mokkabonna
Copy link
Contributor

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 mokkabonna added the help wanted Extra attention is needed label Apr 24, 2019
@wald-tq
Copy link

wald-tq commented Oct 24, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants