ember-env-macros
Get both build and runtime configurations in Ember app or addon.
Compatibility
- Ember.js v3.4 or above
- Ember CLI v2.13 or above
- Node.js v8 or above
Installation
yarn add ember-env-macros
Usage
If you have build env:
// ember-cli-build.jsmodule { let app = defaults 'some-config': buildKey: true nestedKey: key: 'build' ; return app;};
and config env:
module { let ENV = // ... 'some-config': envKey: false nestedKey: key: 'config'
You can get access to them via:
; let model = config: envValue: nestedValue: defaultValue: build: buildValue: nestedValue: defaultValue: ;
The build output will be:
var model = config: envValue: false nestedValue: 'config' defaultValue: 'default' build: buildValue: true nestedValue: 'build' defaultValue: 'default' ;
When used in an addon or engine, both config and build envs are from the host app.
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.