title: Custom grunt plugin not playing nice with grunt-watch
body: <p>I'm developing a custom <a href="https://github.com/freedomflyer/grunt-chrome-extension-reload" rel="nofollow">grunt extension that reloads a chrome tab</a>. It works fine when I use it within the plugin's own folder, but then when I try to download it from NPM and use it in another project, it goes bonkers.</p>
  
  <p>I included it as such:</p>
  
  <pre><code>grunt.loadNpmTasks('grunt-chrome-extension-reload');
  </code></pre>
  
  <p>My custom task code, located in the <code>tasks</code> folder of the plugin, is as such:</p>
  
  <pre><code>/*
   * grunt-chrome-extension-reload
   * https://github.com/freedomflyer/grunt-chrome-extension-reload
   *
   * Copyright (c) 2014 Spencer Gardner
   * Licensed under the MIT license.
   */
  
  'use strict';
  
  module.exports = function(grunt) {
  
    var chromeExtensionTabId = 0;
  
  
    grunt.initConfig({
  
      /**
        Reloads tab in chrome with id of chromeExtensionTabId
        Called after correct tab number is found from chrome-cli binary. 
      */
      exec: {
        reloadChromeTab: {
          cmd: function() {
            return chromeExtensionTabId ? "chrome-cli reload -t " + chromeExtensionTabId : "chrome-cli open chrome://extensions &amp;&amp; chrome-cli reload"; 
          }
        }
      },
  
      /**
        Executes "chrome-cli list tabs", grabs stdout, and finds open extension tabs ID's.
        Sets variable chromeExtensionTabId to the first extension tab ID
      */
      external_daemon: {
        getExtensionTabId: {
          options: {
            verbose: true,
            startCheck: function(stdout, stderr) {
  
              // Find any open tab in Chrome that has the extensions page loaded, grab ID of tab
              var extensionTabMatches = stdout.match(/\[\d{1,5}\] Extensions/);
  
              if(extensionTabMatches){
                var chromeExtensionTabIdContainer = extensionTabMatches[0].match(/\[\d{1,5}\]/)[0];
  
                chromeExtensionTabId = chromeExtensionTabIdContainer.substr(1, chromeExtensionTabIdContainer.length - 2);
                console.log("Chrome Extension Tab #: " + chromeExtensionTabId);
              }
  
              return true;
            }
          },
          cmd: "chrome-cli",
          args: ["list", "tabs"]
        }
      }
  
    });
  
    grunt.registerTask('chrome_extension_reload', function() {
      grunt.task.run(['external_daemon:getExtensionTabId', 'exec:reloadChromeTab']);
    });
  
  };
  </code></pre>
  
  <p>So, when I run it in an external project with <code>grunt watch</code>, grunt spits out this error a few hundred times before quitting (endless loop?)</p>
  
  <pre><code>Running "watch" task
  Waiting...Verifying property watch exists in config...ERROR
  &gt;&gt; Unable to process task.
  Warning: Required config property "watch" missing.
  Fatal error: Maximum call stack size exceeded
  </code></pre>
  
  <p>Interestingly, can not even call my plugin within the <code>watch</code> task, and the problem persists. Only by removing <code>grunt.loadNpmTasks('grunt-chrome-extension-reload');</code> can I get rid of the issue, which basically means that the code inside my task is wrong. Any ideas?</p>