Code:
karma: {
unit: {
if ("<%= grunt.option('Release') %>" )
{
//do nothing
}
else
{
configFile: 'build/karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}
}
}
how to write correct if else statement in gruntfile.js. I am invoking the gruntfile.js using visual studio project file.
Gruntfiles are javascript so it needs to be valid javascript, such as:
karma: {
unit: (function() {
if (grunt.option('Release')) {
return {};
} else {
return {
configFile: 'build/karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
};
}
}())
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With