I have a grunt file configured for 2 different modules. In a single task i can give multiple sources and it all works fine. Now my requirement is to give different options for both the modules say - I want different JsHint rules for both modules and I want both the projects to have separate minified files and a common minified file.
Gruntfile.js ->
jshint: {
  ac:{
      options: {
          laxcomma: true, // maybe we should turn this on? Why do we have these 
          curly: true,
          eqeqeq: true,
          immed: true,
          latedef: true,
          onevar: true
      },
      source: {
          src: ['module1/*.js']
      }
  },
  lib:{
      options: {
          laxcomma: true, // maybe we should turn this on? Why do we have these 
          curly: true,
          eqeqeq: true,
          immed: true,
          latedef: true
      },
      source: {
          src: ['module2/*.js']
      }
  }
}
I saw some of the stack overflow question, but i could only find Grunt-hub as an option where i need to create 2 separate files and then a grunt hub file. I dont want to do that, please guide me how to proceed?
Use targets: http://gruntjs.com/configuring-tasks#task-configuration-and-targets
grunt.initConfig({
  jshint: {
    one: {
      src: ['files/*'],
      options: { /* ... */ }
    },
    two: {
      src: ['files2/*'],
      options: { /* ... */ }
    }
  }
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With