Configuring Your App

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's Application instance.
  • environment by default contains which of the build environments was selected at build time (development, test, or production).

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') {
  // ...
}

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://guides.emberjs.com/v3.25.0/configuring-ember/index