Last active
December 31, 2015 21:59
-
-
Save marcusellis05/8050184 to your computer and use it in GitHub Desktop.
Simple Node script for calling Grunt tasks without the CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var grunt = require('grunt') | |
, args = process.argv.slice(2) | |
, tasks = ['build']; | |
if (args && args.length){ | |
tasks = args; | |
} | |
grunt.cli.tasks = tasks; | |
grunt.cli(); |
the default task is "build", so calling:
node build
with no arguments will run the "build" alias. if you don't have an alias named "build", you may want to change line 5 of this script accordingly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
save this as "build.js" in the root folder of your project (with your "gruntfile.js"). then you call call any of your tasks or aliases but doing something like:
or to call multiple tasks at once: