cooperka / react-native-snackbar

:candy: Material Design "Snackbar" component for Android and iOS.
Other
815 stars 150 forks source link

Reduce size of npm package (when published via Yarn) #143

Closed dwidc closed 4 years ago

dwidc commented 4 years ago

I found that your npm package includes large temporary android files. For example, folder /android/build alone is about 13mb. Mostly on /android/build/tmp and /android/build/intermediates

Shouldn't you exclude those folders from publishing? I also checked on https://www.npmjs.com/package/react-native-snackbar your total package is about 20mb.

cooperka commented 4 years ago

Thanks for the report, @dwidc! I will update .npmignore to reduce bundle size as soon as I can get around to it. PRs also welcome.

cooperka commented 4 years ago

Re-opening re: https://github.com/cooperka/react-native-snackbar/pull/153#issuecomment-634320342

sonicdoe commented 4 years ago

@cooperka To make this work with Yarn, would you rather only have a files field (to include all necessary files) or only have a .npmignore (to exclude all unnecessary files)?

cooperka commented 4 years ago

Hmm it seems like exclusion may be more flexible/simpler. For example to include src but not tests, and some of android but not all. I suppose the downside is that it would be partially redundant with .gitignore? I can accept that 🤷‍♂️

sonicdoe commented 4 years ago

With https://github.com/cooperka/react-native-snackbar/pull/154, I now kind of went the middle way. It effectively still works the same as before but uses .npmignore instead of the files field in order to work around Yarn’s different behavior.