Storytel / react-redux-spinner

An automatic spinner for react and redux
https://storytel.github.io/react-redux-spinner/
MIT License
81 stars 13 forks source link

bundle file is too big #15

Closed themojilla closed 6 years ago

themojilla commented 6 years ago

hi and thanks for this repo the build file is almost 47kb is there any way to reduce that ?

capture

thanks

arturocr commented 6 years ago

I bet this is because it embeds nprogress sources and styles as well, which makes it a reasonable size.

noseglid commented 6 years ago

Hello, Thank you for reporting this. As @arturocr states, it bundles nprogress, so the size is "reasonable". One optimization we're looking to do is to include nprogress as a dependency (rather than as it is now - a devDependency which gets bundled in the react-redux-spinner.

This would only decrease the bundle size if you used nprogress outside of react-redux-spinner.

Additionally I think we could make the CSS inclusion conditional. But this would only help you decrease bundlesize if you provide your own CSS for styling.

I'll keep this issue open to track what we can do to decrease the bundlesize.

noseglid commented 6 years ago

I've found some optimizations which takes it from 46K to 26K.

This is the bundle now:

Bundle: react-redux-spinner
prop-types: 24.88 KB (35.7%)
style-loader: 12.13 KB (17.4%)
nprogress: 11.29 KB (16.2%)
process: 5.17 KB (7.42%)
fbjs: 4.26 KB (6.11%)
css-loader: 2.21 KB (3.17%)
object-assign: 2.06 KB (2.95%)
<self>: 7.7 KB (11.0%)