Ramesh Murugesan
Ramesh Murugesan

Reputation: 5023

Meteor how to load script dynamically?

Is this possible to load script dynamically? for eg. I wish to reduce app weight. so I would like to load role based JS. I know its not best solution to reduce app weight but looking for interesting package or approach

Upvotes: 1

Views: 263

Answers (1)

Brett McLain
Brett McLain

Reputation: 2010

There is no native support for dynamic/lazy loading in Meteor. There is an open request for it though:

https://github.com/MeteorCommunity/discussions/issues/27

And it is on their roadmap:

https://trello.com/c/24s6vyxo/55-incremental-loading

In the meantime there is a package that does help/address this via bundles:

https://github.com/numtel/meteor-lazy-bundles

Upvotes: 2

Related Questions