Test env for the frontend app
lucassus opened this issue · comments
see 445f55c#commitcomment-4830187
and https://github.com/mathiasbynens/grunt-template
and http://www.ng-newsletter.com/advent2013/#/day/5
// Gruntfile
var env = process.env.ENV || 'development';
var config = require('./config/' + env + '.json');
grunt.initConfig({
// ...
'template': {
'config': {
'options': {
data: config
}
},
'files': {
// The .tmp destination is a yeoman
// default location. Set this dest
// to fit your own needs if not using
// yeoman
'.tmp/scripts/config.js':
['src/config.js.tpl']
}
}
// ...
});
grunt.loadNpmTasks('grunt-template');
grunt.registerTask('default', ['template']);
ENV=production grunt build