1

The example from grunt-contrib-less:

less: {
  development: {
    options: {
      paths: ["assets/css"]
    },
    files: {
      "path/to/result.css": "path/to/source.less"
    }
  },
  production: {
    options: {
      paths: ["assets/css"],
      plugins: [
        new require('less-plugin-autoprefix')({browsers: ["last 2 versions"]}),
        new require('less-plugin-clean-css')(cleanCssOptions)
      ],
      modifyVars: {
        imgPath: '"http://mycdn.com/path/to/images"',
        bgColor: 'red'
      }
    },
    files: {
      "path/to/result.css": "path/to/source.less"
    }
  }
}

It provides two entries in the dictionary for less: development and production.

I don't know what to call these entries, perhaps smth like "sub-tasks for less".

  1. Does the naming of these matter?
  2. Is it possible to only run one of these. I've tried $ grunt less development, but that does not work.
Mads Skjern
  • 5,648
  • 6
  • 36
  • 40

1 Answers1

1
  1. The names matter and it's something you configure. These are like more like arguments than sub-tasks. Reference: http://gruntjs.com/api/grunt.task
  2. Try grunt less:development
Caqu
  • 1,154
  • 1
  • 8
  • 14