Install a package on the fly

Hi,

how can i install a package with code on a running meteor instance?

thanks for help

In .meteor/packages you can just remove or add packages as you see fit.

For example:

# Meteor packages used by this project, one per line.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

standard-app-packages
insecure
autopublish

You can remove insecure and autopublish while the server is running just by deleting them from this file.

Are you sure this works with bundled code?

1 Like

@gabrielhpugliese is right… You can’t add packages like that to a bundled application.

Oh I misunderstood the question. This question I do not have the answer for.

Client side packages can in theory be extracted out to live in the public folder and loaded on demand with one of the lazy loading packages you can find on atmosphere.

Server side packages would be hard to get right, but might be possible by reading in from the private folder as assets, parsing them and eval()ing them. Yikes! :smile:

Yeah. It honestly seems easier and less hacky to just rebuild and push the server again.

thanks for all answers,

the hot code push packages like arsnebula:appupdate or gwendall:remote-autoupdate works on a bundled meteor app?

push this packages only client side code?

meteor unbundled in production is not recommended right?

thanks,