diff options
| author | Henry Jameson <me@hjkos.com> | 2018-12-11 18:45:25 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2018-12-11 18:45:25 +0300 |
| commit | b839ba7870c2872607ebf3ae41a8c08f17a7dde7 (patch) | |
| tree | de8941179df23da234f46428a6b899c4e07d7c2e /src | |
| parent | fb5261b926adfb5b9bbe1bf55e36fe8b5f4eb57f (diff) | |
Quality of Frontend Developer's Life: here to stay
Diffstat (limited to 'src')
| -rw-r--r-- | src/boot/after_store.js | 11 | ||||
| -rw-r--r-- | src/main.js | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js index a80baaf5..9ce2d7ed 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -38,8 +38,17 @@ const afterStoreSetup = ({store, i18n}) => { return {} }) .then((staticConfig) => { + const overrides = window.___pleromafe_dev_overrides || {} + const env = window.___pleromafe_mode.NODE_ENV + // This takes static config and overrides properties that are present in apiConfig - var config = Object.assign({}, staticConfig, apiConfig) + let config = {} + if (overrides.staticConfigPreference && env === 'DEV') { + console.warn('OVERRIDING API CONFIG WITH STATIC CONFIG') + config = Object.assign({}, apiConfig, staticConfig) + } else { + config = Object.assign({}, staticConfig, apiConfig) + } var theme = (config.theme) var background = (config.background) diff --git a/src/main.js b/src/main.js index 378fe95c..7f3746c8 100644 --- a/src/main.js +++ b/src/main.js @@ -69,3 +69,9 @@ createPersistedState(persistedStateOptions).then((persistedState) => { afterStoreSetup({store, i18n}) }) + +// These are inlined by webpack's DefinePlugin +/* eslint-disable */ +window.___pleromafe_mode = process.env +window.___pleromafe_commit_hash = COMMIT_HASH +window.___pleromafe_dev_overrides = DEV_OVERRIDES |
