Execution order


I have an error executing dependencies. Here an example.

App.FormFied = Ember.Mixin.create({
    // some code


App.CustomFormField = Em.Component.extend(App.FormField, {
    // some code

If they are positioned in this order everything works as expected. However, when the build tool concatenates them in an alphabetical order (because it uses file names), sometimes the dependency is placed after it is used. Therefore, if it is used before it is defined I get a run time error stating that it is undefined.

I believe ES6 modules fix this issue but I would like to know if there is a way to fix that issue without specifying the order manually.


Order of JavaScript includes makes the difference and many build tools allow to specify order manually. What build tool are you using?


@muchweb I’m having the same issue with Gulp Inject, where I don’t want to specify the script file order manually. Do you know if there is an Ember Way to handle this problem? or is this a task for something like Common JS Modules or ES6 Module Transpiler?