diff --git a/README.md b/README.md index dcd0c252..fee95e8d 100755 --- a/README.md +++ b/README.md @@ -8,6 +8,21 @@ it directly. ## Prerequisites: - Node Package Manager -## Translations in dev mode +## Development + +### Adding a new environment configuration variable + +Any new environment / configuration variable must be registered in several places: + +1. [`./create_config_prod.js`](./create_config_prod.js): mapping the environment variable to a config object entry for + production. +2. [`./webpack.config.js`](./webpack.config.js): setting a default value for the environment variable; used in Webpack development + builds. +3. [`./src/public/config.js`](./src/public/config.js): creating the shape of the global config object (using the config object entry key, + mapped to in 1.) +4. [`./src/js/config.ts`](./src/js/config.ts): loading from the global config object (production) via key or from the + environment variable directly, through Webpack replacement (development). + +### Translations in dev mode Add your English to French translations in `dist/public/locales/fr/translation_fr.json` for them to appear on the website. diff --git a/create_config_prod.js b/create_config_prod.js index 57fdf8e8..c24b95f1 100644 --- a/create_config_prod.js +++ b/create_config_prod.js @@ -6,6 +6,7 @@ const siteConfig = { TRANSLATED: parseBoolean(process.env.BENTO_PUBLIC_TRANSLATED), BEACON_URL: process.env.BEACON_URL || null, BEACON_UI_ENABLED: parseBoolean(process.env.BENTO_BEACON_UI_ENABLED), + BEACON_NETWORK_ENABLED: parseBoolean(process.env.BENTO_BEACON_NETWORK_ENABLED), // Authentication PUBLIC_URL: process.env.BENTO_PUBLIC_URL || null, diff --git a/src/public/config.js b/src/public/config.js index 8e98a7ef..779177de 100644 --- a/src/public/config.js +++ b/src/public/config.js @@ -7,6 +7,7 @@ BENTO_PUBLIC_CONFIG = { TRANSLATED: null, BEACON_URL: null, BEACON_UI_ENABLED: null, + BEACON_NETWORK_ENABLED: null, // Authentication PUBLIC_URL: null, CLIENT_ID: null,