IMP: My Grunt file looks as follows, Now I would like to update URL attached to apiEndpoint key from environment variable.
For example: create a shell script file and insert the url that is needed from environment variable
I would be glad if someone helps me out. Thanks in advance
Code:
module.exports = function (grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required Grunt tasks
require('jit-grunt')(grunt, {
ngconstant: 'grunt-ng-constant'
});
// Define the configuration for all the tasks
grunt.initConfig({
// Project settings
yeoman: appConfig,
ngconstant: {
// Options for all targets
options: {
space: ' ',
wrap: '"use strict";\n\n {\%= __ngModule %}',
name: 'appConfig',
},
// Environment targets
development: {
options: {
dest: '<%= yeoman.app %>/scripts/config.js'
},
constants: {
ENV: {
name: 'development',
apiEndpoint: 'https://blabla.com/v1/login'
}
}
},
production: {
options: {
dest: '<%= yeoman.dist %>/scripts/config.js'
},
constants: {
ENV: {
name: 'production',
apiEndpoint: 'https://blabla.com/v1/login'
}
}
}
}
});
};