Skip to content

How to reduce bundle size of Plotly.js for 3D surface chart? #4891

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

Closed
Rezakarimi66 opened this issue Jun 3, 2020 · 9 comments
Closed

How to reduce bundle size of Plotly.js for 3D surface chart? #4891

Rezakarimi66 opened this issue Jun 3, 2020 · 9 comments

Comments

@Rezakarimi66
Copy link

Hi, Could someone please answer my question here. I have asked it everywhere and no one cares :(

@archmoj
Copy link
Contributor

archmoj commented Jun 3, 2020

@Rezakarimi66
Our gl3d bundle size is 1.4 MB and not 0.5 MB as you mentioned on stackoverflow.
This is close to what you built using webpack.

@Rezakarimi66
Copy link
Author

Rezakarimi66 commented Jun 3, 2020

@archmoj I just double checked the size of latest gl3d bundle. The minimized version which currently I am using (look here) has a size of 465kB. How did you create that file? I have used webpack and also browserify to create such bundle but not successful.
bundle size
Please take a look at my code here

@archmoj
Copy link
Contributor

archmoj commented Jun 9, 2020

@alexcjohnson this is interesting in terms of using webpack instead of browserify.

@Rezakarimi66
Copy link
Author

@alexcjohnson this is interesting in terms of using webpack instead of browserify.

Size of bundle is also big with browserify for me. It's 1.4MB. You could see it with running my script "borwserify-prod" (here). Webpack or browseriy or any other tool doesn't matter for me. Just trying to get the same size as yours.

@archmoj
Copy link
Contributor

archmoj commented Jun 23, 2020

@Rezakarimi66 your fork is rather behind latest changes made to plotly.js including various module upgrades. Could you pull these changes (or on a separate repo) and then try applying your commit on top of that?

@Rezakarimi66
Copy link
Author

@archmoj I updated my package.json file to the latest version ( 1.54.4 ) Nothing changed :(
Could you please share the code that you are using for generating your minified file (https://cdn.plot.ly/plotly-gl3d-latest.min.js)?

@archmoj
Copy link
Contributor

archmoj commented Jun 23, 2020

@Rezakarimi66
Here is what npm run build does:

"build": "npm run preprocess && npm run find-strings && npm run bundle && npm run header && npm run stats",
.
Namely this file could be of interest: https://github.com/plotly/plotly.js/blob/master/tasks/bundle.js

@Rezakarimi66
Copy link
Author

@archmoj Thanks for your helps. I cloned and changed your code to generate my custom bundle and the result was the same. The only possible way to reduce the size is to compress with gzip.

@archmoj
Copy link
Contributor

archmoj commented Jul 30, 2020

@Rezakarimi66 Please see #5301.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants