Skip to content

Instantly share code, notes, and snippets.

@sbalay
Created February 1, 2016 15:56
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 sbalay/537c8d2fa480bbe1a1fd to your computer and use it in GitHub Desktop.
Save sbalay/537c8d2fa480bbe1a1fd to your computer and use it in GitHub Desktop.
Config file for gulp tasks able to read environment settings
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