Old Guides - You are viewing the guides for
Ember
v3.25.0.
While Ember gives you strong defaults so that you might never need to configure anything, it still supports configuring your app if you need to! Ember CLI ships with support for managing your application's environment. The runtime environment for the application is defined in config/environment.js
. Here an object ENV
is built for each of the three Ember CLI-supported build modes: development, test, and production.
Three notable properties on the ENV
object are:
EmberENV
can be used to define Ember feature flags (see the Feature Flags guide) to be enabled at runtime.APP
can be used to pass flags or options to the app'sApplication
instance.environment
by default contains which of the build environments was selected at build time (development
,test
, orproduction
).
The ENV
object is defined at build time, but you can access the ENV
object
in application code via import from your-application-name/config/environment
.
For example:
import ENV from 'your-application-name/config/environment';
if (ENV.environment === 'development') {
// ...
}