Ember CLI: production assembly

I would like to build an Ember CLI application assembly for the staging environment. For the production, I would essentially do the same thing as production (minimization, fingerprinting, test exclusion, etc.), but you want to select environment variables for development. To try this, I changed my environment.js file to an account to create:

 if (environment === 'development' || environment === 'staging') { ENV.someApiKey = 'test-api-key'; } if (environment === 'production') { ENV.someApiKey = 'production-api-key'; } 

When I run ember build --environment=staging , the corresponding ember build --environment=staging environment variables are set, but all other build processes that will be performed for production are not used. Is there a way to tell Ember CLI to build for production, but pick up development environment variables?

+5
source share
1 answer

Ember sets the flag depending on whether the value is ONLY set in / ember-cli / lib / broccoli / ember-app.js:

var isProduction = this.env === 'production';

and then it uses production-specific settings.

So, if you want to create an intermediate assembly, use the process to modify the environment.js before you run ember build, and then when the assembly is finished, return the file to its normal state. We should probably make this process more flexible in the future.

+1
source

All Articles