GESTALT_APPLICATION_PATH=string
GESTALT_ID=string
gestalt is going to generate a path and read the configuration from:
GESTALT_APPLICATION_PATH
CONFIGURATIONS_DIRECTORY
GESTALT_ID.json
We can use different GESTALT_ID
for different environments - development, staging, production, etc.
We can inject environment variables into any configuration via interpolation. For example:
{
module: {
setting: '${gestalt.environment.VARIABLE}'
}
}
-
Link
whatwhywhenandwho-gestalt
. -
Create
source/package-settings.ts
with the following template:import { gestalt } from 'whatwhywhenandwho-gestalt';
import { PACKAGE_NAME } from './definitions/base.definition';
export interface IGestaltPackageSettings { // Define your settings. }
export default gestalt.getPackageSettings( PACKAGE_NAME, { // Define your defaults, if any. } );
-
Export the interface and the settings in
main.ts
as the last entry, so other packages can use them:... import packageSettings, { IGestaltPackageSettings } from './package-settings';
export { ..., IGestaltPackageSettings, packageSettings };
-
Import
packageSettings
wherever you need them.
Have a nice day 😘