Created
February 24, 2015 10:47
-
-
Save csainty/e318a7ede4b83dcb9dce to your computer and use it in GitHub Desktop.
Super simple grunt task to update a json config file in the package
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
grunt.registerTask('config', function (env) { | |
var config = grunt.file.readJSON('src/config.json'); | |
var envs = { | |
production: { | |
apiUrl: 'http://foo.com' | |
}, | |
staging: { | |
apiUrl: 'http://bar.com' | |
} | |
}; | |
config = _.extend(config, envs[env]); | |
grunt.file.write('dist/config.json', JSON.stringify(config)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment