Extending a transpiled Ember CLI application

We’re currently in the process of developing a CMS, the admin panel of which is an Ember application using globals mode. We would like to switch to Ember CLI while the workload to do so remains manageable.

The main roadblock that we are facing with Ember CLI is that we’re not sure of the best way to approach extending the Ember application once it has been built/transpiled. We’d like users to be able to write add-ons for the CMS that could extend the admin panel without requiring them to edit the source code of the admin panel itself.

Currently, this isn’t an issue as the admin panel doesn’t need to be built/transpiled due to it being developed using globals mode, so any JS files required by an add-on to extend the admin panel can just be appended to the pages source and Ember will pick it up as normal.

Using Ember CLI on the other hand, will mean that the source code for the admin panel will need to be built/transpiled, which will be done before the CMS is distributed to the user, rendering the Ember application inaccessible to the JS required by the add-ons.

Are there any solutions for what we’re trying to achieve or are we best sticking with Ember in globals mode? It seems like we may have stumbled upon a use case where Ember CLI may not be the best fit.



I don’t have an answer for you but I’d suggest looking into how people are doing lazy-loading of modules, etc. @toranb has an article that should get you most of the way there Lazy loading es6 modules with emberjs

1 Like