Gur*_*raj 3 javascript jquery gruntjs grunt-contrib-qunit
码:
karma: {
unit: {
if ("<%= grunt.option('Release') %>" )
{
//do nothing
}
else
{
configFile: 'build/karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}
}
}
Run Code Online (Sandbox Code Playgroud)
如何在gruntfile.js中编写正确的if else语句.我正在使用visual studio项目文件调用gruntfile.js.
Gruntfiles是javascript所以它需要是有效的javascript,例如:
karma: {
unit: (function() {
if (grunt.option('Release')) {
return {};
} else {
return {
configFile: 'build/karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
};
}
}())
}
Run Code Online (Sandbox Code Playgroud)