Browse files

fix less task overwriting object

Commit 0729eeb changed one call to
_.merge so it would overwrite the object. This reverts
this one line accordingly.


    metadata = _.merge({},, metadata,

_.merge (see [0]( overwrites the
first argument, since this is used as the destination. Using just
a clean object as destination, _.merge will also return the destination
object and store this result into metadata.

Overwriting is a big problem if the `less` task is
used in combination with other tasks like `compress` from the
grunt-contrib-compress library. There is a `compress` option for
assemble-less, that will be available in
``. Merging this into
will then overwrite the configuration of the compress task (with `true`
in this case). Leading to a very strange error message from grunt, since
some kind of object is expected there.
  • Loading branch information...
1 parent d4ef403 commit 98dccd39b36e6c4e777426a077761fff4ec4d7a4 @johnyb johnyb committed with johnyb Mar 26, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 tasks/less.js
@@ -224,7 +224,7 @@ module.exports = function(grunt) {
// Read in metadata to pass to templates as context.
var metadata = utils.readOptionsData(options.metadata, {namespace: true});
- metadata = _.merge(, metadata,;
+ metadata = _.merge({},, metadata,;
metadata = grunt.config.process(metadata);
if (options.process === true) {options.process = {};}

0 comments on commit 98dccd3

Please sign in to comment.