Last active
March 19, 2019 20:18
-
-
Save Serginho/0bd7fd91abf152e08368df76760310c2 to your computer and use it in GitHub Desktop.
Environment splitted configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// global.ts | |
export const ENVIRONMENT_GLOBAL = { | |
appVersion: '1.0', | |
browserSupport: [ | |
{ | |
name: 'Chrome', | |
version: 45 | |
}, | |
{ | |
name: 'Firefox', | |
version: 40 | |
}, | |
{ | |
name: 'Safari', | |
version: 9 | |
} | |
] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dev.ts | |
import {ENVIRONMENT_GLOBAL} from './global'; | |
import * as deepmerge from 'deepmerge'; | |
export const ENVIRONMENT_DEV = deepmerge.all([{}, ENVIRONMENT_GLOBAL, { | |
production: false, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prod.ts | |
import {ENVIRONMENT_GLOBAL} from './global'; | |
import * as deepmerge from 'deepmerge'; | |
export const ENVIRONMENT_PROD = deepmerge.all([{}, ENVIRONMENT_GLOBAL, { | |
production: true, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// environment.ts | |
import {ENVIRONMENT_DEV} from './dev'; | |
import * as deepmerge from 'deepmerge'; | |
export const environment = deepmerge.all([{}, ENVIRONMENT_DEV, { | |
endpoint: 'mysite.dev/rest' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// environment.prod.ts | |
import {ENVIRONMENT_PROD} from './prod'; | |
import * as deepmerge from 'deepmerge'; | |
export const environment = deepmerge.all([{}, ENVIRONMENT_PROD, { | |
endpoint: 'mysite.dev/rest' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment