How to use the grunt.tasks function in grunt

To help you get started, we’ve selected a few grunt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bahmutov / grunty / bin / grunty.js View on Github external
}
};

// console.log('grunt.tasks', grunt.tasks);

function done() {
  console.log('grunt is done');
}

var options = {
  verbose: Boolean(grunt.cli.options.verbose),
  gruntfile: fakeGruntfile
};

if (target) {
  grunt.tasks([target], options, done);
}
// console.log(grunt.file);
// grunt.cli();
github pingyuanChen / generator-admin / lib / util.js View on Github external
},
        files: sassFiles
        // files: { // Dictionary of files
        //   sassSrc[0]: sassSrc[1], // 'destination': 'source'
        // }
      }
    }
  });

  var cwd = process.cwd();
  process.chdir(path.join(__dirname, '../'));//because the loadNpmTasks'root path is based on the process.cwd()
  grunt.loadNpmTasks('grunt-jsbeautifier');
  grunt.loadNpmTasks('grunt-contrib-sass');
  process.chdir(cwd);

  grunt.tasks(['jsbeautifier', 'sass:dev'], {}, function(){
    grunt.log.ok('grunt task done');
  });
}
github reboundjs / rebound / bin / start-test-server.js View on Github external
#!/usr/bin/env node
var grunt = require('grunt').tasks(['start']);
github thedjpetersen / subway / lib / static.js View on Github external
initialize(function() {

    if (env === 'dev') {
      grunt.tasks(["clean", "symlink", "jade", "react", "styl"], {}, cb);

      gaze("src/components/**/*.jsx", function(err, watcher) {
        this.on("all", function(event, filepath) {
          console.log("Change on: " + filepath);
          grunt.tasks(["react"], {}, function() {});
        });
      });

      gaze("src/jade/**/*.jade", function(err, watcher) {
        this.on("all", function(event, filepath) {
          console.log("Change on: " + filepath);
          grunt.tasks(["jade"], {}, function() {});
        });
      });

      gaze("src/styl/**/*.styl", function(err, watcher) {
github BorderTech / wcomponents / wcomponents-theme / theme-watch.js View on Github external
return new Promise(function(win) {
				themeLinter.run(path.join(dir, filename));
				grunt.option("filename", filename);
				grunt.tasks(["copy:test"], { filename: filename }, win);
			});
		}
github tgideas / motion / component / http.js View on Github external
fs.exists(filePath, function(result){
      if(result){
        readFromBuild()
      }else{
        grunt.tasks(buildTask, {}, readFromBuild);
      }
    });
  }
github swagger-api / swagger-editor / start.js View on Github external
.on('end', function () {
    grunt.tasks('serve');
  });
github tgideas / motion / component / http.js View on Github external
}else{
          data = iconv.encode(data, charset);
          if(zepto){
            fs.readFile('./src/zepto.js', function(err, zeptoData){
              response.write(iconv.encode(zeptoData+'\n', charset) + data);
              response.end();
            })
          }else{
            response.write(data);
            response.end();
          }
        }
    });
  }
  if(repackage){
    grunt.tasks(buildTask, {}, readFromBuild);
  }else{
    fs.exists(filePath, function(result){
      if(result){
        readFromBuild()
      }else{
        grunt.tasks(buildTask, {}, readFromBuild);
      }
    });
  }
}
github MJGrant / osu-cs-class-explorer / gulpfile.babel.js View on Github external
gulp.task('buildcontrol:openshift', function(done) {
    grunt.tasks(
        ['buildcontrol:openshift'],    //you can add more grunt tasks in this array
        {gruntfile: false}, //don't look for a Gruntfile - there is none. :-)
        function() {done();}
    );
});