pulyaevskiy / firebase-functions-interop

Firebase Functions Interop Library for Dart.
BSD 3-Clause "New" or "Revised" License
191 stars 52 forks source link

Large package when deploying #57

Open ghost opened 4 years ago

ghost commented 4 years ago

Firebase creates a 38 MB package when I try to deploy my functions. Usually, my functions have less than 1 mb.

a

Curiously, node_modules has exactly 38 MB, however it is supposed to be automatically ignored (https://stackoverflow.com/a/51182549/6696558).

Is this normal when using this package? Is there any configuration I can do to exclude unwanted parts?

interrobrian commented 4 years ago

The culprit appears to be the .dart_tools and packages directories, which aren't necessary at runtime. Here's what I did to fix it:

Re-run npm install in the functions directory and it should work. Cut mine down from 36MB for the sample Hello World to 97KB while the function still works.

StefanLobbenmeier commented 4 years ago

Good finding! I was able to reduce to 100kb. But I wanted to add one more thing - on this page https://console.cloud.google.com/ you can download the files that have been deployed to firebase: image

That helped me understand what the ignore is actually doing / what still had to be added to the ignore in my case.