Skip to content

Instantly share code, notes, and snippets.

@Serginho
Last active March 19, 2019 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Serginho/0bd7fd91abf152e08368df76760310c2 to your computer and use it in GitHub Desktop.
Save Serginho/0bd7fd91abf152e08368df76760310c2 to your computer and use it in GitHub Desktop.
Environment splitted configuration
// global.ts
export const ENVIRONMENT_GLOBAL = {
appVersion: '1.0',
browserSupport: [
{
name: 'Chrome',
version: 45
},
{
name: 'Firefox',
version: 40
},
{
name: 'Safari',
version: 9
}
]
};
// dev.ts
import {ENVIRONMENT_GLOBAL} from './global';
import * as deepmerge from 'deepmerge';
export const ENVIRONMENT_DEV = deepmerge.all([{}, ENVIRONMENT_GLOBAL, {
production: false,
});
// prod.ts
import {ENVIRONMENT_GLOBAL} from './global';
import * as deepmerge from 'deepmerge';
export const ENVIRONMENT_PROD = deepmerge.all([{}, ENVIRONMENT_GLOBAL, {
production: true,
});
// environment.ts
import {ENVIRONMENT_DEV} from './dev';
import * as deepmerge from 'deepmerge';
export const environment = deepmerge.all([{}, ENVIRONMENT_DEV, {
endpoint: 'mysite.dev/rest'
});
// 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