简体   繁体   中英

EmberJS - Minimal dependencies loading

I have an EmberJS single page frontend app. I want to split resources(js/html) loaded for different pages. Right now, ember builds the hole javascript code into a single file which then is included in the DOM. The same with the templates.

What I want is to load a small piece of template/js for some specify routes, because I need them to be fast. When the user moves to a new route, I can download the hole one-page app, but for these routes I need the minimum resources loaded.

How can I achieve this using emberjs?

To my knowledge there's no way to do that using EmberJS. Ember-CLI will build your project into the app-name.js file (will all your routes/templates/components) and the vendor.js file which contains all the files you included in your ember-cli-build.js using app.import() .

I've seen people ask this, but I never seen a reply which included a way to do this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM