grunt-pretasks
Pre Tasks for Grunt
Getting Started
This plugin requires Grunt >=0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins.
Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-pretasks --save-dev
Once the plugin has been installed, it needs to be enabled inside your Gruntfile with this line of JavaScript:
note: you must place this line before loading any task
grunt;
Usage
To run pre tasks just add a preTasks: [task...]
property to the options object of the task that you wish to run the pre task(s) before.
The following example will run ['cleanArtifacts', 'compile', 'compileTests']
before any call to karma
or karma:chrome
or karma:firefox
etc...
karma: options: preTasks: 'cleanArtifacts' 'compile' 'compileTests' configFile: './test/karma/config.js' chrome: browsers: 'Chrome' singleRun: false firefox: browsers: 'Firefox' singleRun: false ie: browsers: 'IE' singleRun: false singleRunFirefox: browsers: 'Firefox' singleRun: true all: browsers: 'Chrome' 'Firefox' 'IE' ;