Native Package Manager

npm

Need private packages and team management tools?Check out npm Orgs. »

grunt-pretasks

0.0.3 • Public • Published

grunt-pretasks

Pre Tasks for Grunt

NPM version NPM downloads

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

require('grunt-pretasks')(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']
  }
};

install

npm i grunt-pretasks

Downloadsweekly downloads

0

version

0.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability