window.MyApp not set in production build


#1

In a debug build, I’m able to access my current application like this:

window.MyApp.[...]

However in production builds, this global variable is not set (undefined). Going over the documentation of Application it notes that you should do this yourself. However in ember-cli this is done automatically for debug builds? I’m confused and would like to have the variable available in production as well. I looked over the environment configuration for debug and production, and they are the same. So is this configurable somewhere? How can I access my application from external javascript in production builds?


#2

See the readme of https://github.com/ember-cli/ember-export-application-global for instructions


#3

Thank you! There’s a lot of packages in my package.json that’ve been added by ember-cli. I’ll review the ones in there, now that I come to think of it.