Skip to content

Instantly share code, notes, and snippets.

@vilmosioo
Last active December 23, 2015 04:39
Show Gist options
  • Save vilmosioo/6581960 to your computer and use it in GitHub Desktop.
Save vilmosioo/6581960 to your computer and use it in GitHub Desktop.
Example usage of ng-constant to create environment variables.
grunt.initConfig({
ngconstant: {
dev: [
{
dest: 'path/to/constants.js',
name: 'Constants',
constants: {
'<constant name>': grunt.file.readJSON('path/to/dev.json'),
}
}
],
prod: [ // same as dev task except the JSON source file is different
{
dest: 'path/to/constants.js',
name: 'Constants',
constants: {
'<constant name>': grunt.file.readJSON('path/to/prod.json'),
}
}
],
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment