1

When running ember build --environment staging I get a build error. In config/environment.js I have a condition looking for staging so I can change the baseUrl to our staging services. But when I try and build with the environment set I get the following error:

You must pass a file to 'EmberApp::import'. For directories specify them to the constructor under the 'trees' option.

Is this a problem with ember-cli or do I need to declare my environment in my Brocfile somehow?

4

1 回答 1

1

由于 Ember 当前存在自定义环境问题,请尝试使用 shell 变量来修改单个 Ember 生产环境中的行为。

如果您像这样调用 ember,DEPLOY_ENV=staging ember build --environment=production您将能够访问DEPLOY_ENV所有 J​​S 文件中的变量,process.env.DEPLOY_ENV并相应地修改它们的行为。

我个人喜欢将部署环境与应用程序环境解耦,因为它允许拥有一个类似于生产环境的登台服务器。

于 2014-10-25T00:28:14.183 回答