gruntjs - Executing two gruntfile.js? -



gruntjs - Executing two gruntfile.js? -

recently created separate codebase our mobile site m.xyz.com , optimized performance. implemented grunt in codebase. now, planning utilize same codebase our upcoming new desktop version. so, structuring 1 codebase mobile / desktop.

now, whole project have 1 gruntfile.js written mobile. how can split task mobile / desktop ? say, if execute "grunt mobile" mobile gruntfile.js executed. if type "grunt desktop" desktop gruntfile.js executed. there other way resolve scenario ?

if don't want parse command line arguments yourself, create sense set option. phone call grunt task --mobile.

module.exports = function (grunt) { if(grunt.option('mobile')) { require('gruntfile.mobile.js')(grunt); } else if(grunt.option('desktop')) { require('gruntfile.desktop.js')(grunt); } }

gruntjs

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -