简体   繁体   English

有没有办法在 environment.js 中区分 ember 服务和 Ember 构建?

[英]Is there a way to differentiate ember serve from Ember build in environment.js?

I would like to either be able to pass an argument in ember build that differentiates it from ember serve (http://localhost:4200).我希望能够在ember build中传递一个参数,以将其与 ember serve (http://localhost:4200) 区分开来。

I am trying to have a different rootURL when running locally through localhost:4200 and when it is a build in the dev server using ember build https://www.example.com/app .当通过localhost:4200在本地运行时,以及使用ember build https://www.example.com/app在开发服务器中构建时,我试图使用不同的rootURL

Otherwise is it possible to set the default environment of Ember serve to be 'local' instead of 'development?否则是否可以将 Ember 服务的默认环境设置为“本地”而不是“开发”?

After a lot of research and without a way to do it with built-in functionality, I decided to use ember-cli-dotenv .经过大量研究并且无法使用内置功能来完成它,我决定使用ember-cli-dotenv

I added a git-ignored .env file with IS_LOCAL = true for my local and IS_LOCAL = false in my development/staging/production environments that are in the servers.我在服务器中的开发/暂存/生产环境中添加了一个 git-ignored .env文件,其中IS_LOCAL = true用于我的本地和IS_LOCAL = false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM