-
Notifications
You must be signed in to change notification settings - Fork 71
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
Easy method to specify plotly dist package #5
Comments
Thanks for pointing out this one. I will need sometime to take it careffuly and find out what can be done. |
See my comment for the other vue-plotly library: plotly.js is used as external in vue-plotly. So you can configure to resove plotly.js as you want in your own project. webpack.config.js:
|
I tried specifying the plotly.js alias to plotly-basic.js as above, but now I am seeing some build errors.
Here is my current bundle composition I am basically try to get rid of mapbox-gl which I don't use for my project but gets loaded by VuePlotly. . Is there a way to selectively disable some modules? |
try with plotly.js$:
|
@wald-tq Thanks! That worked! |
I am stuck. Locally, I can npm build, which runs: vue-cli-service build and everything works out. I can load and use vue-plotly with the entire plotly functionality. But sadly our build system get's a HEAP memory error when building this library, so after googling around I've come to understand I should point to one of the partial installs to get around that. It seems to be a common problem with building plotly apparently. I attempted to do what was pointed out above and our builds still fail. Perhaps I'm doing something wrong. I'm not familiar with this approach, so I may have a core misconception as to what I should be doing. Any help would be appreciated, since this seems to be the only work around that I've found for our situation. If I follow correctly, I should have this for my vue.config.js:
I confirmed that my webpack config is picking it up. Because doing a vue-cli-service inspect outputs the generated webpack config:
In my package.json, I've got many dependencies, but for vue plotly, I've got these dependencies: |
@jerkald: how do you import plotly into your code? Do your builds still fail with the heap memory error? Have you tried giving your build host more memory? Is more memory available? Can you configure node.js to use more memory e.g. |
edit: previous comments removed for clarity After doing a bunch of testing I found things were building correctly. I then found out that the build server's memory was boosted and it gave me a false positive, where i though my changes were causing the fix. Of course I posted a bunch of stuff before I realized this, so I've edited that out, as to not confuse anyone. I also did some additional tests now that it built and found that the alias was working using the approach suggested above, but the HEAP issue was my real problem. I think the answer here is that if you're hitting HEAP issues while building plotly, you'll need to consider adding more memory to your build system and look into using the |
Plotly and Webpack can be adjusted to use either precompiled versions of plotly (to prevent es6 errors) or reduce size via precompiled packages that can greatly decrease the size of plotly (especially if only 1 basic type is used).
see: https://github.com/plotly/plotly-webpack#the-easy-way-recommended
Would there be an easy method to specify this?
The text was updated successfully, but these errors were encountered: