Created
February 1, 2016 15:56
-
-
Save sbalay/537c8d2fa480bbe1a1fd to your computer and use it in GitHub Desktop.
Config file for gulp tasks able to read environment settings
This file contains hidden or 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
import { argv } from 'yargs'; | |
export default { | |
environment: argv.env || 'development', | |
getConfigKeys () { | |
let keys; | |
try { | |
keys = require(`./${this.environment}`); | |
} catch (e) { | |
throw new Error(`No config file found for environment ${this.environment}`); | |
} | |
keys.environment = this.environment; | |
return keys; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment