Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

grunt-pulse

Stop building & testing your whole project when only one file changed...

readme

grunt-pulse v0.1.0

What is this?

A plugin for Grunt that...

-

Table of Contents

     Installation

     Example

-

Installation

In your terminal:

npm install --save-dev grunt-pulse

In your Gruntfile.js:

grunt.loadNpmTasks("grunt-pulse")

But I suggest using load-grunt-tasks:

require("load-grunt-tasks")(grunt) // loads every installed "grunt-*" module

-

Example

In the example below, the anonymous task runs after clean completes and before build starts.

grunt.config.merge({
  pulse: {
    src: ["src"],
    dest: ["dest"],
    ext: "coffee",
    build: function (files) {
      // See the 'Options' section for info on what to do here.
      grunt.task.then("webpack", {
        entry: files.reduce(function (entry, file, i) {
          entry[file] = file
        }, {})
      })
    },
    test: function (files) {
      // See the 'Options' section for info on what to do here.
      grunt.task.then("karma", {
        files: files.reduce(function (files, file, i) {
          files.push({
            pattern: file
          })
        }, []),
        autoWatch: false
      })
    },
    test: function (files) {}
  }
})

The this variable in anonymous tasks is the same as in registered tasks.