How to run other registered grumbling tasks inside the grunt plugin?

I am working on writing a grunt plugin that will help in the build process, which I use quite often. What I usually do is copy / paste my GruntFile from project to project, but I think it might be a little more useful if you include it in the plugin. Tasks that I use for this assembly process, are typically tasks such as jshint, copy, cssmin, lessand uglify, among others. I think I could clear my Gruntfile.jstone file if I could create a plugin that just accepted some kind of configuration and completed all of these tasks.

My current setup usually looks something like this:

grunt.initConfig({
  jshint: {/* ... */},
  copy: {/* ... */},
  less: {/* ... */},
  cssmin: {/* ... */},
  uglify: {/* ... */}
});

  // Load and Register tasks...

but I would like to reduce initConfig to something like this:

grunt.initConfig({
  build: {
    dev: {
      paths: {
        public: 'public',
        source: 'source',
        bower: 'bower_components'
      },
      options: {
        pretty: true,
        minify: false
      }
    }
  }
});

-, grunt?

EDIT: - , , , , , , , .

grunt grunt?

+4
1
+4

All Articles