使用environment = production部署到heroku的Ember-CLI应用程序将丢失全局应用程序命名空间

Jai*_*ime 2 environment heroku ember.js ember-cli

我的应用程序名称是App,当环境=开发时,我可以访问App命名空间.唯一的问题是当我通过运行使用生产版本时出现问题(ember server --environment = production,然后我不再访问App命名空间,因为它未定义.

Error while processing route: coming-soon App is not defined ReferenceError: App is not defined
Run Code Online (Sandbox Code Playgroud)

这是ember-cli采取的安全措施吗?我怎么能覆盖这个呢?

Ram*_*oya 5

Ember-cli附带了addon ember-export-application-global.默认情况下,它不会将应用程序名称导出到生产环境中的全局范围.
您可以通过添加以下内容来覆盖此行为config/environment.js:

//config/environment.js
module.exports = function(environment) {
  var ENV = {
    //...
    //...
    exportApplicationGlobal: true
      //...
      //...
  }

  //...
  //...
};
Run Code Online (Sandbox Code Playgroud)