[Pkg-javascript-commits] [node-grunt-contrib-less] 01/03: Import Upstream version 1.4.0

Johannes Schauer josch at moszumanska.debian.org
Wed Jan 4 23:57:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

josch pushed a commit to branch master
in repository node-grunt-contrib-less.

commit e31d3e37a28eb7d52b08455fbce547363c9b8e30
Author: Johannes 'josch' Schauer <josch at mister-muffin.de>
Date:   Thu Jan 5 00:12:07 2017 +0100

    Import Upstream version 1.4.0
---
 .gitattributes                              |   1 +
 .gitignore                                  |   3 +
 .jshintrc                                   |  14 ++
 .travis.yml                                 |  18 ++
 AUTHORS                                     |   9 +
 CHANGELOG                                   | 159 ++++++++++++++++++
 CONTRIBUTING.md                             |   1 +
 Gruntfile.js                                | 251 ++++++++++++++++++++++++++++
 LICENSE-MIT                                 |  22 +++
 README.md                                   | 241 ++++++++++++++++++++++++++
 appveyor.yml                                |  39 +++++
 docs/less-examples.md                       |  30 ++++
 docs/less-options.md                        | 140 ++++++++++++++++
 docs/less-overview.md                       |   1 +
 docs/overview.md                            |   1 +
 package.json                                |  39 +++++
 tasks/less.js                               | 196 ++++++++++++++++++++++
 test/expected/banner.css                    |   5 +
 test/expected/banner2.css                   |   5 +
 test/expected/compress.css                  |   1 +
 test/expected/concat.css                    |  12 ++
 test/expected/customFunctions.css           |   5 +
 test/expected/ieCompatFalse.css             |   5 +
 test/expected/ieCompatTrue.css              |   5 +
 test/expected/individual/level2/style3.css  |   3 +
 test/expected/individual/style.css          |   3 +
 test/expected/individual/style2.css         |   3 +
 test/expected/individual_flatten/style.css  |   3 +
 test/expected/individual_flatten/style2.css |   3 +
 test/expected/individual_flatten/style3.css |   3 +
 test/expected/less.css                      |   3 +
 test/expected/modifyVars.css                |   4 +
 test/expected/nomatches.css                 |   0
 test/expected/nopaths.css                   |   3 +
 test/expected/pathsFunction.css             |   3 +
 test/expected/pluginCleancss.css            |   1 +
 test/expected/plugins.css                   |   1 +
 test/expected/string.css                    |   3 +
 test/expected/variablesAsLess.css           |   3 +
 test/fixtures/customFunctions.less          |   5 +
 test/fixtures/ieCompat.less                 |   5 +
 test/fixtures/include/bob.jpg               | Bin 0 -> 65126 bytes
 test/fixtures/include/variables.less        |   1 +
 test/fixtures/include/variablesAsLess.css   |   1 +
 test/fixtures/level2/style3.less            |   4 +
 test/fixtures/modifyVars.less               |   8 +
 test/fixtures/nopaths.less                  |   4 +
 test/fixtures/pathsFunction.less            |   4 +
 test/fixtures/plugins.less                  |   7 +
 test/fixtures/style.less                    |   4 +
 test/fixtures/style2.less                   |   4 +
 test/fixtures/style3.less                   |   4 +
 test/fixtures/style4.less                   |   4 +
 test/fixtures/variablesAsLess.less          |   4 +
 test/less_test.js                           | 176 +++++++++++++++++++
 55 files changed, 1477 insertions(+)

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5cb6bfd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+node_modules
+npm-debug.log
+tmp
\ No newline at end of file
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..3568a66
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,14 @@
+{
+  "boss": true,
+  "curly": true,
+  "eqeqeq": true,
+  "eqnull": true,
+  "immed": true,
+  "latedef": false,
+  "newcap": true,
+  "noarg": true,
+  "node": true,
+  "sub": true,
+  "undef": true,
+  "unused": true
+}
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..2eac80c
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,18 @@
+sudo: false
+
+language: node_js
+
+node_js:
+  - "0.10"
+  - "0.12"
+  - "4"
+  - "5"
+  - "6"
+  - "iojs"
+
+matrix:
+  fast_finish: true
+
+cache:
+  directories:
+    - node_modules
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..bd3004e
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,9 @@
+Tyler Kellen (http://goingslowly.com/)
+"Cowboy" Ben Alman (http://benalman.com/)
+Chris Talkington (http://christalkington.com/)
+Teddy Cross (http://tkaz.ec/)
+Justin Searls (http://about.me/searls/)
+Thomas Boyt (http://www.thomasboyt.com/)
+Jake Harding (http://thejakeharding.com/)
+Jason Karns (http://jasonkarns.com/)
+Sebastian Tschan (https://blueimp.net/)
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 0000000..742f26a
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,159 @@
+v1.4.0:
+  date: 2016-07-21
+  changes:
+    - Update async and less to ~2.7.1.
+v1.3.0:
+  date: 2016-04-07
+  changes:
+    - Update lodash and async dependecies.
+v1.2.0:
+  date: 2016-02-01
+  changes:
+    - Update to less ~2.6.0.
+    - Removed peerDependency from package.json.
+v1.1.0:
+  date: 2015-11-09
+  changes:
+    - Update to less ~2.5.0.
+v1.0.0:
+  date: 2014-12-23
+  changes:
+    - Update to less 2.1.0.
+v0.12.0:
+  date: 2014-10-23
+  changes:
+    - Added `cleancssOptions` as an option.
+    - When possible, includes filename for failed writes.
+    - Ensure banner only outputs on the first file in a series.
+v0.11.4:
+  date: 2014-07-29
+  changes:
+    - Fix `banner` and `urlArgs` LESS options.
+    - Fixes npm 2 peerDependencies issues.
+v0.11.3:
+  date: 2014-06-20
+  changes:
+    - Update to Less ~1.7.2.
+v0.11.2:
+  date: 2014-06-01
+  changes:
+    - Lock to less 1.7.0.
+v0.11.1:
+  date: 2014-05-26
+  changes:
+    - Fix `modifyVars` to work when less file ends with a comment.
+v0.11.0:
+  date: 2014-03-19
+  changes:
+    - Custom functions can return types defined by less.
+    - '`paths` option now accepts a function.'
+    - Replaced deprecated `grunt.util` methods.
+    - Removes deprecated `grunt.lib.contrib`.
+v0.10.0:
+  date: 2014-03-01
+  changes:
+    - '`sourceMapBasepath` accepts a function.'
+    - Update copyright to 2014.
+    - Update .gitattributes.
+    - Update less.js to v1.7.0.
+    - Prevent CRLF in the repo.
+    - Adds modify-vars option.
+    - Changed to async stack call.
+    - Fixes data-uri test.
+    - Normalize line endings on tests.
+v0.9.0:
+  date: 2014-01-07
+  changes:
+    - Bump to less 1.6.
+v0.8.3:
+  date: 2013-12-06
+  changes:
+    - Support `sourceMapURL`.
+v0.8.2:
+  date: 2013-11-14
+  changes:
+    - Support `outputSourceFiles`.
+v0.8.1:
+  date: 2013-10-24
+  changes:
+    - Support `sourceMapFilename`, `sourceMapBasepath` and `sourceMapRootpath`.
+v0.8.0:
+  date: 2013-10-22
+  changes:
+    - Upgrade to LESS 1.5.
+    - Support `strictUnits` option.
+    - Support `sourceMap` option.
+    - Add `customFunctions` option for defining custom functions within LESS.
+    - Output the source file name on error.
+    - '`yuicompress` option now cleancss (Less changed underlying dependency)'
+v0.7.0:
+  date: 2013-08-08
+  changes:
+    - Downgrade no source files warning to only in verbose mode.
+v0.6.5:
+  date: 2013-08-08
+  changes:
+    - Support `strictMath` option.
+    - Support `rootpath` parse option.
+v0.6.4:
+  date: 2013-07-09
+  changes:
+    - Support `relativeUrls` option.
+v0.6.3:
+  date: 2013-07-06
+  changes:
+    - Add `report` option for minification and gzip results.
+v0.6.2:
+  date: 2013-07-03
+  changes:
+    - support `syncImport`.
+v0.6.1:
+  date: 2013-06-12
+  changes:
+    - Support `ieCompat`.
+v0.6.0:
+  date: 2013-06-09
+  changes:
+    - Bump less to 1.4.0.
+v0.5.2:
+  date: 2013-05-23
+  changes:
+    - Improve error handling.
+v0.5.1:
+  date: 2013-04-25
+  changes:
+    - Gracefully handle configuration without sources.
+v0.5.0:
+  date: 2013-02-15
+  changes:
+    - First official release for Grunt 0.4.0.
+v0.5.0rc7:
+  date: 2013-01-23
+  changes:
+    - Updating grunt/gruntplugin dependencies to rc7.
+    - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.
+    - Remove experimental wildcard destination support.
+    - Switching to `this.files` API.
+v0.3.2:
+  date: 2012-10-18
+  changes:
+    - Add support for `dumpLineNumbers`.
+v0.3.1:
+  date: 2012-10-12
+  changes:
+    - Rename grunt-contrib-lib dep to grunt-lib-contrib.
+v0.3.0:
+  date: 2012-09-24
+  changes:
+    - Global options depreciated.
+    - Revert normalize linefeeds.
+v0.2.2:
+  date: 2012-09-16
+  changes:
+    - Support all less options.
+    - Normalize linefeeds.
+    - Default path to dirname of src file.
+v0.2.0:
+  date: 2012-09-10
+  changes:
+    - Refactored from grunt-contrib into individual repo.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..5d08cc3
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project.
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..cdabfe5
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,251 @@
+/*
+ * grunt-contrib-less
+ * http://gruntjs.com/
+ *
+ * Copyright (c) 2016 Tyler Kellen, contributors
+ * Licensed under the MIT license.
+ */
+
+'use strict';
+
+module.exports = function(grunt) {
+
+  // Project configuration.
+  grunt.initConfig({
+    jshint: {
+      all: [
+        'Gruntfile.js',
+        'tasks/*.js',
+        '<%= nodeunit.tests %>'
+      ],
+      options: {
+        jshintrc: '.jshintrc'
+      }
+    },
+
+    // Before generating any new files, remove any previously-created files.
+    clean: {
+      tests: ['tmp']
+    },
+
+    // Configuration to be run (and then tested).
+    less: {
+      compile: {
+        options: {
+          paths: ['test/fixtures/include']
+        },
+        files: {
+          'tmp/string.css': 'test/fixtures/style.less',
+          'tmp/less.css': ['test/fixtures/style.less'],
+          'tmp/concat.css': ['test/fixtures/style.less', 'test/fixtures/style2.less', 'test/fixtures/style3.less']
+        }
+      },
+      compress: {
+        options: {
+          paths: ['test/fixtures/include'],
+          compress: true
+        },
+        files: {
+          'tmp/compress.css': ['test/fixtures/style.less']
+        }
+      },
+      nopaths: {
+        files: {
+          'tmp/nopaths.css': ['test/fixtures/nopaths.less']
+        }
+      },
+      banner: {
+        options: {
+          banner: '/* banner */\n'
+        },
+        files: {
+          'tmp/banner.css': 'test/fixtures/style3.less',
+          'tmp/banner2.css': 'test/fixtures/style4.less'
+        }
+      },
+      pathsFunction: {
+        options: {
+          paths: function(srcFile) {
+            var path = require('path');
+            return [path.dirname(srcFile) + '/include'];
+          }
+        },
+        files: {
+          'tmp/pathsFunction.css': ['test/fixtures/pathsFunction.less']
+        }
+      },
+      plugins: {
+        options: {
+          paths: ['test/fixtures/include'],
+          plugins: [new (require('less-plugin-clean-css'))({keepSpecialComments: 0})]
+        },
+        files: {
+          'tmp/plugins.css': ['test/fixtures/plugins.less']
+        }
+      },
+      ieCompatTrue: {
+        options: {
+          paths: ['test/fixtures/include'],
+          ieCompat: true
+        },
+        files: {
+          'tmp/ieCompatTrue.css': ['test/fixtures/ieCompat.less']
+        }
+      },
+      ieCompatFalse: {
+        options: {
+          paths: ['test/fixtures/include'],
+          ieCompat: false
+        },
+        files: {
+          'tmp/ieCompatFalse.css': ['test/fixtures/ieCompat.less']
+        }
+      },
+      nofiles: {
+      },
+      nomatchedfiles: {
+        files: {
+          'tmp/nomatchedfiles.css': 'test/nonexistent/*.less'
+        }
+      },
+      compressMultipleSource: {
+        options: {
+          paths: ['test/fixtures/include'],
+          compress: true
+        },
+        files: {
+          'tmp/compressMultipleSource.css': ['test/fixtures/style.less', 'test/fixtures/style2.less']
+        }
+      },
+      pluginCleancss: {
+        options: {
+          paths: ['test/fixtures/include'],
+          plugins: [new (require('less-plugin-clean-css'))()],
+          compress: true
+        },
+        files: {
+          'tmp/pluginCleancss.css': ['test/fixtures/style.less', 'test/fixtures/style2.less', 'test/fixtures/style3.less']
+        }
+      },
+      variablesAsLess: {
+        src: 'test/fixtures/variablesAsLess.less',
+        dest: 'tmp/variablesAsLess.css'
+      },
+      sourceMap: {
+        options: {
+          sourceMap: true
+        },
+        src: 'test/fixtures/style3.less',
+        dest: 'tmp/sourceMap.css'
+      },
+      sourceMapFilename: {
+        options: {
+          sourceMap: true,
+          sourceMapFilename: 'tmp/sourceMapFilename.css.map'
+        },
+        src: 'test/fixtures/style3.less',
+        dest: 'tmp/sourceMapFilename.css'
+      },
+      sourceMapURL: {
+        options: {
+          sourceMap: true,
+          sourceMapFilename: 'tmp/sourceMap.css.map',
+          sourceMapURL: 'custom/url/for/sourceMap.css.map'
+        },
+        src: 'test/fixtures/style3.less',
+        dest: 'tmp/sourceMapWithCustomURL.css'
+      },
+      sourceMapBasepath: {
+        options: {
+          sourceMap: true,
+          sourceMapFilename: 'tmp/sourceMapBasepath.css.map',
+          sourceMapBasepath: 'test/fixtures/'
+        },
+        src: 'test/fixtures/style3.less',
+        dest: 'tmp/sourceMapBasepath.css'
+      },
+      sourceMapBasepathFunction: {
+        options: {
+          sourceMap: true,
+          sourceMapFilename: 'tmp/sourceMapBasepath.css.map',
+          sourceMapBasepath: function(dest) {
+            var path = require('path');
+            return path.dirname(dest);
+          }
+        },
+        src: 'test/fixtures/style3.less',
+        dest: 'tmp/sourceMapBasepath.css'
+      },
+      sourceMapRootpath: {
+        options: {
+          sourceMap: true,
+          sourceMapFilename: 'tmp/sourceMapRootpath.css.map',
+          sourceMapRootpath: 'http://example.org/'
+        },
+        src: 'test/fixtures/style3.less',
+        dest: 'tmp/sourceMapRootpath.css'
+      },
+      sourceMapLessInline: {
+        options: {
+          sourceMap: true,
+          sourceMapFilename: 'tmp/sourceMapLessInline.css.map',
+          outputSourceFiles: true
+        },
+        src: 'test/fixtures/style3.less',
+        dest: 'tmp/sourceMapLessInline.css'
+      },
+      testCustomFunctions: {
+        options: {
+          customFunctions: {
+            'get-color': function() {
+              return 'red';
+            },
+            'multiple-args': function(less, arg1, arg2) {
+              return Number(arg1.value) + arg2.value + arg1.unit.numerator[0];
+            },
+            'string-result': function() {
+              return '"Hello"';
+            }
+          }
+        },
+        files: {
+          'tmp/customFunctions.css': ['test/fixtures/customFunctions.less']
+        }
+      },
+      modifyVars: {
+        options: {
+          modifyVars: {
+            // Note the double quotes in 'imgPath'
+            imgPath: '"/somewhere/else"',
+            customPadding: '20px'
+          }
+        },
+        files: {
+          'tmp/modifyVars.css': ['test/fixtures/modifyVars.less']
+        }
+      }
+    },
+
+    // Unit tests.
+    nodeunit: {
+      tests: ['test/*_test.js']
+    }
+  });
+
+  // Actually load this plugin's task(s).
+  grunt.loadTasks('tasks');
+
+  // These plugins provide necessary tasks.
+  grunt.loadNpmTasks('grunt-contrib-jshint');
+  grunt.loadNpmTasks('grunt-contrib-clean');
+  grunt.loadNpmTasks('grunt-contrib-nodeunit');
+  grunt.loadNpmTasks('grunt-contrib-internal');
+
+  // Whenever the "test" task is run, first clean the "tmp" dir, then run this
+  // plugin's task(s), then test the result.
+  grunt.registerTask('test', ['jshint', 'clean', 'less', 'nodeunit']);
+
+  // By default, lint and run all tests.
+  grunt.registerTask('default', ['test', 'build-contrib']);
+
+};
diff --git a/LICENSE-MIT b/LICENSE-MIT
new file mode 100644
index 0000000..0c7e4eb
--- /dev/null
+++ b/LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2016 Tyler Kellen, contributors
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3aca1a1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,241 @@
+# grunt-contrib-less v1.4.0 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-less.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-less) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/e3aa4d07xe4w4u05/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-less/branch/master)
+
+> Compile LESS files to CSS
+
+
+
+## Getting Started
+
+If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
+
+```shell
+npm install grunt-contrib-less --save-dev
+```
+
+Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
+
+```js
+grunt.loadNpmTasks('grunt-contrib-less');
+```
+
+*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-less/tree/grunt-0.3-stable).*
+
+
+## Less task
+_Run this task with the `grunt less` command._
+
+Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.
+### Options
+
+#### paths
+Type: `String` `Array` `Function`  
+Default: Directory of input file.
+
+Specifies directories to scan for @import directives when parsing. Default value is the directory of the source, which is probably what you want.
+
+If you specify a function the source filepath will be the first argument. You can return either a string or an array of paths to be used.
+
+#### rootpath
+Type: `String`  
+Default: `""`
+
+A path to add on to the start of every URL resource.
+
+#### compress
+Type: `Boolean`  
+Default: `false`
+
+Compress output by removing some whitespaces.
+
+#### plugins
+Type: `Array`  
+Default: `null`
+
+Allows passing plugins.
+
+#### ieCompat
+Type: `Boolean`  
+Default: `true`
+
+Enforce the CSS output is compatible with Internet Explorer 8.
+
+For example, the [data-uri](http://lesscss.org/functions/#misc-functions-data-uri) function encodes a file in base64 encoding and embeds it into the generated CSS files as a data-URI. Because Internet Explorer 8 limits `data-uri`s to 32KB, the ieCompat option prevents `less` from exceeding this.
+
+#### optimization
+Type: `Integer`  
+Default: `null`
+
+Set the parser's optimization level. The lower the number, the less nodes it will create in the tree. This could matter for debugging, or if you want to access the individual nodes in the tree.
+
+#### strictImports
+Type: `Boolean`  
+Default: `false`
+
+Force evaluation of imports.
+
+#### strictMath
+Type: `Boolean`  
+Default: `false`
+
+When enabled, math is required to be in parenthesis.
+
+#### strictUnits
+Type: `Boolean`  
+Default: `false`
+
+When enabled, less will validate the units used (e.g. 4px/2px = 2, not 2px and 4em/2px throws an error).
+
+#### syncImport
+Type: `Boolean`  
+Default: `false`
+
+Read @import'ed files synchronously from disk.
+
+#### dumpLineNumbers
+Type: `String`  
+Default: `false`
+
+Configures -sass-debug-info support.
+
+Accepts following values: `comments`, `mediaquery`, `all`.
+
+#### relativeUrls
+Type: `Boolean`  
+Default: `false`
+
+Rewrite URLs to be relative. false: do not modify URLs.
+
+#### customFunctions
+Type: `Object`  
+Default: none
+
+Define custom functions to be available within your LESS stylesheets. The function's name must be lowercase.
+In the definition, the first argument is the less object, and subsequent arguments are from the less function call.
+Values passed to the function are types defined within less, the return value may be either one of them or primitive.
+See the LESS documentation for more information on the available types.
+
+#### sourceMap
+Type: `Boolean`  
+Default: `false`
+
+Enable source maps.
+
+#### sourceMapFilename
+Type: `String`  
+Default: none
+
+Write the source map to a separate file with the given filename.
+
+#### sourceMapURL
+Type: `String`  
+Default: none
+
+Override the default URL that points to the source map from the compiled CSS file.
+
+#### sourceMapBasepath
+Type: `String`  
+Default: none
+
+Sets the base path for the less file paths in the source map.
+
+#### sourceMapRootpath
+Type: `String`  
+Default: none
+
+Adds this path onto the less file paths in the source map.
+
+#### sourceMapFileInline
+Type: `Boolean`  
+Default: false
+
+Puts the map (and any less files) as a base64 data uri into the output css file.
+
+#### outputSourceFiles
+Type: `Boolean`  
+Default: false
+
+Puts the less files into the map instead of referencing them.
+
+#### modifyVars
+Type: `Object`  
+Default: none
+
+Overrides global variables. Equivalent to `--modify-vars='VAR=VALUE'` option in less.
+
+#### banner
+Type: `String`  
+Default: none
+
+### Usage Examples
+
+```js
+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'
+    }
+  }
+}
+```
+
+
+## Release History
+
+ * 2016-07-21   v1.4.0   Update async and less to ~2.7.1.
+ * 2016-04-07   v1.3.0   Update lodash and async dependecies.
+ * 2016-02-01   v1.2.0   Update to less ~2.6.0. Removed peerDependency from package.json.
+ * 2015-11-09   v1.1.0   Update to less ~2.5.0.
+ * 2014-12-23   v1.0.0   Update to less 2.1.0.
+ * 2014-10-23   v0.12.0   Added `cleancssOptions` as an option. When possible, includes filename for failed writes. Ensure banner only outputs on the first file in a series.
+ * 2014-07-29   v0.11.4   Fix `banner` and `urlArgs` LESS options. Fixes npm 2 peerDependencies issues.
+ * 2014-06-20   v0.11.3   Update to Less ~1.7.2.
+ * 2014-06-01   v0.11.2   Lock to less 1.7.0.
+ * 2014-05-26   v0.11.1   Fix `modifyVars` to work when less file ends with a comment.
+ * 2014-03-19   v0.11.0   Custom functions can return types defined by less. `paths` option now accepts a function. Replaced deprecated `grunt.util` methods. Removes deprecated `grunt.lib.contrib`.
+ * 2014-03-01   v0.10.0   `sourceMapBasepath` accepts a function. Update copyright to 2014. Update .gitattributes. Update less.js to v1.7.0. Prevent CRLF in the repo. Adds modify-vars option. Changed to async stack call. Fixes data-uri test. Normalize line endings on tests.
+ * 2014-01-07   v0.9.0   Bump to less 1.6.
+ * 2013-12-06   v0.8.3   Support `sourceMapURL`.
+ * 2013-11-14   v0.8.2   Support `outputSourceFiles`.
+ * 2013-10-24   v0.8.1   Support `sourceMapFilename`, `sourceMapBasepath` and `sourceMapRootpath`.
+ * 2013-10-22   v0.8.0   Upgrade to LESS 1.5. Support `strictUnits` option. Support `sourceMap` option. Add `customFunctions` option for defining custom functions within LESS. Output the source file name on error. `yuicompress` option now cleancss (Less changed underlying dependency)
+ * 2013-08-08   v0.7.0   Downgrade no source files warning to only in verbose mode.
+ * 2013-08-08   v0.6.5   Support `strictMath` option. Support `rootpath` parse option.
+ * 2013-07-09   v0.6.4   Support `relativeUrls` option.
+ * 2013-07-06   v0.6.3   Add `report` option for minification and gzip results.
+ * 2013-07-03   v0.6.2   support `syncImport`.
+ * 2013-06-12   v0.6.1   Support `ieCompat`.
+ * 2013-06-09   v0.6.0   Bump less to 1.4.0.
+ * 2013-05-23   v0.5.2   Improve error handling.
+ * 2013-04-25   v0.5.1   Gracefully handle configuration without sources.
+ * 2013-02-15   v0.5.0   First official release for Grunt 0.4.0.
+ * 2013-01-23   v0.5.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. Remove experimental wildcard destination support. Switching to `this.files` API.
+ * 2012-10-18   v0.3.2   Add support for `dumpLineNumbers`.
+ * 2012-10-12   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib.
+ * 2012-09-24   v0.3.0   Global options depreciated. Revert normalize linefeeds.
+ * 2012-09-16   v0.2.2   Support all less options. Normalize linefeeds. Default path to dirname of src file.
+ * 2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo.
+
+---
+
+Task submitted by [Tyler Kellen](http://goingslowly.com/)
+
+*This file was generated on Thu Jul 21 2016 11:18:02.*
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..62725fb
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,39 @@
+clone_depth: 10
+
+version: "{build}"
+
+# What combinations to test
+environment:
+  matrix:
+    - nodejs_version: "0.10"
+      platform: x86
+    - nodejs_version: "0.12"
+      platform: x86
+    - nodejs_version: "4"
+      platform: x64
+    - nodejs_version: "4"
+      platform: x86
+    - nodejs_version: "5"
+      platform: x86
+    - nodejs_version: "6"
+      platform: x86
+
+install:
+  - ps: Install-Product node $env:nodejs_version $env:platform
+  - npm install
+
+test_script:
+  # Output useful info for debugging
+  - node --version && npm --version
+  # We test multiple Windows shells because of prior stdout buffering issues
+  # filed against Grunt. https://github.com/joyent/node/issues/3584
+  - ps: "npm test # PowerShell" # Pass comment to PS for easier debugging
+  - cmd: npm test
+
+build: off
+
+matrix:
+  fast_finish: true
+
+cache:
+  - node_modules -> package.json
diff --git a/docs/less-examples.md b/docs/less-examples.md
new file mode 100644
index 0000000..cecac41
--- /dev/null
+++ b/docs/less-examples.md
@@ -0,0 +1,30 @@
+# Usage Examples
+
+```js
+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'
+    }
+  }
+}
+```
diff --git a/docs/less-options.md b/docs/less-options.md
new file mode 100644
index 0000000..40a06f0
--- /dev/null
+++ b/docs/less-options.md
@@ -0,0 +1,140 @@
+# Options
+
+## paths
+Type: `String` `Array` `Function`  
+Default: Directory of input file.
+
+Specifies directories to scan for @import directives when parsing. Default value is the directory of the source, which is probably what you want.
+
+If you specify a function the source filepath will be the first argument. You can return either a string or an array of paths to be used.
+
+## rootpath
+Type: `String`  
+Default: `""`
+
+A path to add on to the start of every URL resource.
+
+## compress
+Type: `Boolean`  
+Default: `false`
+
+Compress output by removing some whitespaces.
+
+## plugins
+Type: `Array`  
+Default: `null`
+
+Allows passing plugins.
+
+## ieCompat
+Type: `Boolean`  
+Default: `true`
+
+Enforce the CSS output is compatible with Internet Explorer 8.
+
+For example, the [data-uri](http://lesscss.org/functions/#misc-functions-data-uri) function encodes a file in base64 encoding and embeds it into the generated CSS files as a data-URI. Because Internet Explorer 8 limits `data-uri`s to 32KB, the ieCompat option prevents `less` from exceeding this.
+
+## optimization
+Type: `Integer`  
+Default: `null`
+
+Set the parser's optimization level. The lower the number, the less nodes it will create in the tree. This could matter for debugging, or if you want to access the individual nodes in the tree.
+
+## strictImports
+Type: `Boolean`  
+Default: `false`
+
+Force evaluation of imports.
+
+## strictMath
+Type: `Boolean`  
+Default: `false`
+
+When enabled, math is required to be in parenthesis.
+
+## strictUnits
+Type: `Boolean`  
+Default: `false`
+
+When enabled, less will validate the units used (e.g. 4px/2px = 2, not 2px and 4em/2px throws an error).
+
+## syncImport
+Type: `Boolean`  
+Default: `false`
+
+Read @import'ed files synchronously from disk.
+
+## dumpLineNumbers
+Type: `String`  
+Default: `false`
+
+Configures -sass-debug-info support.
+
+Accepts following values: `comments`, `mediaquery`, `all`.
+
+## relativeUrls
+Type: `Boolean`  
+Default: `false`
+
+Rewrite URLs to be relative. false: do not modify URLs.
+
+## customFunctions
+Type: `Object`  
+Default: none
+
+Define custom functions to be available within your LESS stylesheets. The function's name must be lowercase.
+In the definition, the first argument is the less object, and subsequent arguments are from the less function call.
+Values passed to the function are types defined within less, the return value may be either one of them or primitive.
+See the LESS documentation for more information on the available types.
+
+## sourceMap
+Type: `Boolean`  
+Default: `false`
+
+Enable source maps.
+
+## sourceMapFilename
+Type: `String`  
+Default: none
+
+Write the source map to a separate file with the given filename.
+
+## sourceMapURL
+Type: `String`  
+Default: none
+
+Override the default URL that points to the source map from the compiled CSS file.
+
+## sourceMapBasepath
+Type: `String`  
+Default: none
+
+Sets the base path for the less file paths in the source map.
+
+## sourceMapRootpath
+Type: `String`  
+Default: none
+
+Adds this path onto the less file paths in the source map.
+
+## sourceMapFileInline
+Type: `Boolean`  
+Default: false
+
+Puts the map (and any less files) as a base64 data uri into the output css file.
+
+## outputSourceFiles
+Type: `Boolean`  
+Default: false
+
+Puts the less files into the map instead of referencing them.
+
+## modifyVars
+Type: `Object`  
+Default: none
+
+Overrides global variables. Equivalent to `--modify-vars='VAR=VALUE'` option in less.
+
+## banner
+Type: `String`  
+Default: none
diff --git a/docs/less-overview.md b/docs/less-overview.md
new file mode 100644
index 0000000..f0c452b
--- /dev/null
+++ b/docs/less-overview.md
@@ -0,0 +1 @@
+Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.
\ No newline at end of file
diff --git a/docs/overview.md b/docs/overview.md
new file mode 100644
index 0000000..02a30fa
--- /dev/null
+++ b/docs/overview.md
@@ -0,0 +1 @@
+*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-less/tree/grunt-0.3-stable).*
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..51d94fe
--- /dev/null
+++ b/package.json
@@ -0,0 +1,39 @@
+{
+  "name": "grunt-contrib-less",
+  "description": "Compile LESS files to CSS",
+  "version": "1.4.0",
+  "author": {
+    "name": "Grunt Team",
+    "url": "http://gruntjs.com/"
+  },
+  "repository": "gruntjs/grunt-contrib-less",
+  "license": "MIT",
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "main": "tasks/less.js",
+  "scripts": {
+    "test": "grunt test"
+  },
+  "dependencies": {
+    "async": "^2.0.0",
+    "chalk": "^1.0.0",
+    "less": "~2.7.1",
+    "lodash": "^4.8.2"
+  },
+  "devDependencies": {
+    "grunt": "^1.0.0",
+    "grunt-contrib-clean": "^1.0.0",
+    "grunt-contrib-internal": "^1.1.0",
+    "grunt-contrib-jshint": "^1.0.0",
+    "grunt-contrib-nodeunit": "^1.0.0",
+    "less-plugin-clean-css": "^1.5.0"
+  },
+  "keywords": [
+    "gruntplugin"
+  ],
+  "files": [
+    "tasks"
+  ],
+  "appveyor_id": "e3aa4d07xe4w4u05"
+}
diff --git a/tasks/less.js b/tasks/less.js
new file mode 100644
index 0000000..3678181
--- /dev/null
+++ b/tasks/less.js
@@ -0,0 +1,196 @@
+/*
+ * grunt-contrib-less
+ * http://gruntjs.com/
+ *
+ * Copyright (c) 2016 Tyler Kellen, contributors
+ * Licensed under the MIT license.
+ */
+
+'use strict';
+
+var path = require('path');
+var _ = require('lodash');
+var async = require('async');
+var chalk = require('chalk');
+var less = require('less');
+
+module.exports = function(grunt) {
+  grunt.registerMultiTask('less', 'Compile LESS files to CSS', function() {
+    var done = this.async();
+
+    var options = this.options({
+      banner: ''
+    });
+
+    if (this.files.length < 1) {
+      grunt.verbose.warn('Destination not written because no source files were provided.');
+    }
+
+    var tally = {
+      sheets: 0,
+      maps: 0
+    };
+
+    async.eachSeries(this.files, function(f, nextFileObj) {
+      var destFile = f.dest;
+
+      var files = f.src.filter(function(filepath) {
+        // Warn on and remove invalid source files (if nonull was set).
+        if (!grunt.file.exists(filepath)) {
+          grunt.log.warn('Source file "' + filepath + '" not found.');
+          return false;
+        }
+        return true;
+      });
+
+      if (files.length === 0) {
+        if (f.src.length < 1) {
+          grunt.log.warn('Destination ' + chalk.cyan(destFile) + ' not written because no source files were found.');
+        }
+
+        // No src files, goto next target. Warn would have been issued above.
+        return nextFileObj();
+      }
+
+      var compiled = [];
+      var i = 0;
+
+      async.concatSeries(files, function(file, next) {
+        if (i++ > 0) {
+          options.banner = '';
+        }
+
+        compileLess(file, destFile, options)
+          .then(function(output) {
+            compiled.push(output.css);
+            if (options.sourceMap && !options.sourceMapFileInline) {
+              var sourceMapFilename = options.sourceMapFilename;
+              if (!sourceMapFilename) {
+                sourceMapFilename = destFile + '.map';
+              }
+              grunt.file.write(sourceMapFilename, output.map);
+              grunt.verbose.writeln('File ' + chalk.cyan(sourceMapFilename) + ' created.');
+              tally.maps++;
+            }
+            process.nextTick(next);
+          },
+          function(err) {
+            nextFileObj(err);
+          });
+      }, function() {
+        if (compiled.length < 1) {
+          grunt.log.warn('Destination ' + chalk.cyan(destFile) + ' not written because compiled files were empty.');
+        } else {
+          var allCss = compiled.join(options.compress ? '' : grunt.util.normalizelf(grunt.util.linefeed));
+          grunt.file.write(destFile, allCss);
+          grunt.verbose.writeln('File ' + chalk.cyan(destFile) + ' created');
+          tally.sheets++;
+        }
+        nextFileObj();
+      });
+
+    }, function () {
+      if (tally.sheets) {
+        grunt.log.ok(tally.sheets + ' ' + grunt.util.pluralize(tally.sheets, 'stylesheet/stylesheets') + ' created.');
+      }
+
+      if (tally.maps) {
+        grunt.log.ok(tally.maps + ' ' + grunt.util.pluralize(tally.maps, 'sourcemap/sourcemaps') + ' created.');
+      }
+
+      done();
+    });
+  });
+
+  var compileLess = function(srcFile, destFile, options) {
+    options = _.assign({filename: srcFile}, options);
+    options.paths = options.paths || [path.dirname(srcFile)];
+
+    if (_.isFunction(options.paths)) {
+      try {
+        options.paths = options.paths(srcFile);
+      } catch (e) {
+        grunt.fail.warn(wrapError(e, 'Generating @import paths failed.'));
+      }
+    }
+
+    if (options.sourceMap && !options.sourceMapFileInline && !options.sourceMapFilename) {
+      options.sourceMapFilename = destFile + '.map';
+    }
+
+    if (_.isFunction(options.sourceMapBasepath)) {
+      try {
+        options.sourceMapBasepath = options.sourceMapBasepath(srcFile);
+      } catch (e) {
+        grunt.fail.warn(wrapError(e, 'Generating sourceMapBasepath failed.'));
+      }
+    }
+
+    if (_.isBoolean(options.sourceMap) && options.sourceMap) {
+      options.sourceMap = {
+        sourceMapBasepath: options.sourceMapBasepath,
+        sourceMapFilename: options.sourceMapFilename,
+        sourceMapInputFilename: options.sourceMapInputFilename,
+        sourceMapFullFilename: options.sourceMapFullFilename,
+        sourceMapURL: options.sourceMapURL,
+        sourceMapRootpath: options.sourceMapRootpath,
+        outputSourceFiles: options.outputSourceFiles,
+        sourceMapFileInline: options.sourceMapFileInline
+      };
+    }
+
+    var srcCode = grunt.file.read(srcFile);
+
+    // Equivalent to --modify-vars option.
+    // Properties under options.modifyVars are appended as less variables
+    // to override global variables.
+    var modifyVarsOutput = parseVariableOptions(options.modifyVars);
+    if (modifyVarsOutput) {
+      srcCode += '\n' + modifyVarsOutput;
+    }
+
+    // Load custom functions
+    if (options.customFunctions) {
+      Object.keys(options.customFunctions).forEach(function(name) {
+        less.functions.functionRegistry.add(name.toLowerCase(), function() {
+          var args = [].slice.call(arguments);
+          args.unshift(less);
+          var res = options.customFunctions[name].apply(this, args);
+          return _.isObject(res) ? res : new less.tree.Anonymous(res);
+        });
+      });
+    }
+
+    return less.render(srcCode, options)
+      .catch(function(err) {
+        lessError(err, srcFile);
+      });
+  };
+
+  var parseVariableOptions = function(options) {
+    var pairs = _.toPairs(options);
+    var output = '';
+    pairs.forEach(function(pair) {
+      output += '@' + pair[0] + ':' + pair[1] + ';';
+    });
+    return output;
+  };
+
+  var formatLessError = function(e) {
+    var pos = '[' + 'L' + e.line + ':' + ('C' + e.column) + ']';
+    return e.filename + ': ' + pos + ' ' + e.message;
+  };
+
+  var lessError = function(e, file) {
+    var message = less.formatError ? less.formatError(e) : formatLessError(e);
+
+    grunt.log.error(message);
+    grunt.fail.warn('Error compiling ' + file);
+  };
+
+  var wrapError = function (e, message) {
+    var err = new Error(message);
+    err.origError = e;
+    return err;
+  };
+};
diff --git a/test/expected/banner.css b/test/expected/banner.css
new file mode 100644
index 0000000..b411171
--- /dev/null
+++ b/test/expected/banner.css
@@ -0,0 +1,5 @@
+/* banner */
+#footer {
+  color: #377;
+  background: #233;
+}
diff --git a/test/expected/banner2.css b/test/expected/banner2.css
new file mode 100644
index 0000000..fdd5998
--- /dev/null
+++ b/test/expected/banner2.css
@@ -0,0 +1,5 @@
+/* banner */
+#body {
+  color: #377;
+  background: #233;
+}
diff --git a/test/expected/compress.css b/test/expected/compress.css
new file mode 100644
index 0000000..1045a2c
--- /dev/null
+++ b/test/expected/compress.css
@@ -0,0 +1 @@
+body{color:#ffffff}
\ No newline at end of file
diff --git a/test/expected/concat.css b/test/expected/concat.css
new file mode 100644
index 0000000..a1f1d2a
--- /dev/null
+++ b/test/expected/concat.css
@@ -0,0 +1,12 @@
+body {
+  color: #ffffff;
+}
+
+#header {
+  background: #ffffff;
+}
+
+#footer {
+  color: #377;
+  background: #233;
+}
diff --git a/test/expected/customFunctions.css b/test/expected/customFunctions.css
new file mode 100644
index 0000000..cd98825
--- /dev/null
+++ b/test/expected/customFunctions.css
@@ -0,0 +1,5 @@
+.myRule {
+  background-color: red;
+  width: 5px;
+  background: "Hello";
+}
diff --git a/test/expected/ieCompatFalse.css b/test/expected/ieCompatFalse.css
new file mode 100644
index 0000000..6dfad77
--- /dev/null
+++ b/test/expected/ieCompatFalse.css
@@ -0,0 +1,5 @@
+body {
+  width: 288px;
+  height: 288px;
+  background: transparent url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAwADAAD/7RtYUGhvdG9zaG9wIDMuMAA4QklNBCUAAAAAABAAAAAAAAAAAAAAAAAAAAAAOEJJTQPtAAAAAAAQAAMAAAABAAEAAwAAAAEAAThCSU0EJgAAAAAADgAAAAAAAAAAAAA/gAAAOEJJTQQNAAAAAAAEAAAAHjhCSU0EGQAAAAAABAAAAB44QklNA/MAAAAAAAkAAAAAAAAAAAEAOEJJTQQKAAAAAAABAAA4QklNJxAAAAAAAAoAAQAAAAAAAAACOEJJTQP1AAAAAABIAC9mZgABAGxmZgAGAAAAAAABAC9mZgABAKGZmgAGAAAAAAABADIAAAABAFoAAAAGAAAAAAABADUAAAABAC0AAAAGAAAAAAABOEJJTQP4AAAAAABwAAD/////////////////////////// [...]
+}
diff --git a/test/expected/ieCompatTrue.css b/test/expected/ieCompatTrue.css
new file mode 100644
index 0000000..3552ce1
--- /dev/null
+++ b/test/expected/ieCompatTrue.css
@@ -0,0 +1,5 @@
+body {
+  width: 288px;
+  height: 288px;
+  background: transparent url('include/bob.jpg') 0 0 no-repeat;
+}
diff --git a/test/expected/individual/level2/style3.css b/test/expected/individual/level2/style3.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/individual/level2/style3.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/individual/style.css b/test/expected/individual/style.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/individual/style.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/individual/style2.css b/test/expected/individual/style2.css
new file mode 100644
index 0000000..3eb6931
--- /dev/null
+++ b/test/expected/individual/style2.css
@@ -0,0 +1,3 @@
+#header {
+  background: #ffffff;
+}
diff --git a/test/expected/individual_flatten/style.css b/test/expected/individual_flatten/style.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/individual_flatten/style.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/individual_flatten/style2.css b/test/expected/individual_flatten/style2.css
new file mode 100644
index 0000000..3eb6931
--- /dev/null
+++ b/test/expected/individual_flatten/style2.css
@@ -0,0 +1,3 @@
+#header {
+  background: #ffffff;
+}
diff --git a/test/expected/individual_flatten/style3.css b/test/expected/individual_flatten/style3.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/individual_flatten/style3.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/less.css b/test/expected/less.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/less.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/modifyVars.css b/test/expected/modifyVars.css
new file mode 100644
index 0000000..d998914
--- /dev/null
+++ b/test/expected/modifyVars.css
@@ -0,0 +1,4 @@
+.nice-kitty {
+  padding: 20px;
+  background: url('/somewhere/else/nice-kitty.jpg');
+}
diff --git a/test/expected/nomatches.css b/test/expected/nomatches.css
new file mode 100644
index 0000000..e69de29
diff --git a/test/expected/nopaths.css b/test/expected/nopaths.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/nopaths.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/pathsFunction.css b/test/expected/pathsFunction.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/pathsFunction.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/pluginCleancss.css b/test/expected/pluginCleancss.css
new file mode 100644
index 0000000..4a152bd
--- /dev/null
+++ b/test/expected/pluginCleancss.css
@@ -0,0 +1 @@
+body{color:#fff}#header{background:#fff}#footer{color:#377;background:#233}
\ No newline at end of file
diff --git a/test/expected/plugins.css b/test/expected/plugins.css
new file mode 100644
index 0000000..2a6eb0d
--- /dev/null
+++ b/test/expected/plugins.css
@@ -0,0 +1 @@
+body{color:#fff}
\ No newline at end of file
diff --git a/test/expected/string.css b/test/expected/string.css
new file mode 100644
index 0000000..ef8eb94
--- /dev/null
+++ b/test/expected/string.css
@@ -0,0 +1,3 @@
+body {
+  color: #ffffff;
+}
diff --git a/test/expected/variablesAsLess.css b/test/expected/variablesAsLess.css
new file mode 100644
index 0000000..3eb6931
--- /dev/null
+++ b/test/expected/variablesAsLess.css
@@ -0,0 +1,3 @@
+#header {
+  background: #ffffff;
+}
diff --git a/test/fixtures/customFunctions.less b/test/fixtures/customFunctions.less
new file mode 100644
index 0000000..a2ad14c
--- /dev/null
+++ b/test/fixtures/customFunctions.less
@@ -0,0 +1,5 @@
+.myRule {
+  background-color: get-color(red);
+  width: multiple-args(1px, 4px);
+  background: string-result(3);
+}
diff --git a/test/fixtures/ieCompat.less b/test/fixtures/ieCompat.less
new file mode 100644
index 0000000..20463e6
--- /dev/null
+++ b/test/fixtures/ieCompat.less
@@ -0,0 +1,5 @@
+body {
+	width: 288px;
+	height: 288px;
+	background: transparent data-uri('include/bob.jpg') 0 0 no-repeat;
+}
diff --git a/test/fixtures/include/bob.jpg b/test/fixtures/include/bob.jpg
new file mode 100644
index 0000000..0676f14
Binary files /dev/null and b/test/fixtures/include/bob.jpg differ
diff --git a/test/fixtures/include/variables.less b/test/fixtures/include/variables.less
new file mode 100644
index 0000000..48a2113
--- /dev/null
+++ b/test/fixtures/include/variables.less
@@ -0,0 +1 @@
+ at color: #ffffff;
diff --git a/test/fixtures/include/variablesAsLess.css b/test/fixtures/include/variablesAsLess.css
new file mode 100644
index 0000000..48a2113
--- /dev/null
+++ b/test/fixtures/include/variablesAsLess.css
@@ -0,0 +1 @@
+ at color: #ffffff;
diff --git a/test/fixtures/level2/style3.less b/test/fixtures/level2/style3.less
new file mode 100644
index 0000000..2a2f0d3
--- /dev/null
+++ b/test/fixtures/level2/style3.less
@@ -0,0 +1,4 @@
+ at import "variables.less";
+body {
+  color: @color;
+}
diff --git a/test/fixtures/modifyVars.less b/test/fixtures/modifyVars.less
new file mode 100644
index 0000000..a626586
--- /dev/null
+++ b/test/fixtures/modifyVars.less
@@ -0,0 +1,8 @@
+ at imgPath: '/path/to/images';
+ at customPadding: 12px;
+
+.nice-kitty {
+  padding: @customPadding;
+  background: url('@{imgPath}/nice-kitty.jpg')
+}
+// comments
\ No newline at end of file
diff --git a/test/fixtures/nopaths.less b/test/fixtures/nopaths.less
new file mode 100644
index 0000000..dcb229a
--- /dev/null
+++ b/test/fixtures/nopaths.less
@@ -0,0 +1,4 @@
+ at import "include/variables.less";
+body {
+  color: @color;
+}
diff --git a/test/fixtures/pathsFunction.less b/test/fixtures/pathsFunction.less
new file mode 100644
index 0000000..2a2f0d3
--- /dev/null
+++ b/test/fixtures/pathsFunction.less
@@ -0,0 +1,4 @@
+ at import "variables.less";
+body {
+  color: @color;
+}
diff --git a/test/fixtures/plugins.less b/test/fixtures/plugins.less
new file mode 100644
index 0000000..7064679
--- /dev/null
+++ b/test/fixtures/plugins.less
@@ -0,0 +1,7 @@
+/*!
+ * Comment
+ */
+ at import "variables.less";
+body {
+  color: @color;
+}
diff --git a/test/fixtures/style.less b/test/fixtures/style.less
new file mode 100644
index 0000000..95ac28a
--- /dev/null
+++ b/test/fixtures/style.less
@@ -0,0 +1,4 @@
+ at import "variables.less";
+body {
+  color: @color;
+}
\ No newline at end of file
diff --git a/test/fixtures/style2.less b/test/fixtures/style2.less
new file mode 100644
index 0000000..8478aa1
--- /dev/null
+++ b/test/fixtures/style2.less
@@ -0,0 +1,4 @@
+ at import "variables.less";
+#header {
+  background: @color;
+}
diff --git a/test/fixtures/style3.less b/test/fixtures/style3.less
new file mode 100644
index 0000000..b6d23b1
--- /dev/null
+++ b/test/fixtures/style3.less
@@ -0,0 +1,4 @@
+#footer {
+  color: #377;
+  background: #233;
+}
diff --git a/test/fixtures/style4.less b/test/fixtures/style4.less
new file mode 100644
index 0000000..fc2cab1
--- /dev/null
+++ b/test/fixtures/style4.less
@@ -0,0 +1,4 @@
+#body {
+  color: #377;
+  background: #233;
+}
diff --git a/test/fixtures/variablesAsLess.less b/test/fixtures/variablesAsLess.less
new file mode 100644
index 0000000..97f7ef1
--- /dev/null
+++ b/test/fixtures/variablesAsLess.less
@@ -0,0 +1,4 @@
+ at import (less) "include/variablesAsLess.css";
+#header {
+  background: @color;
+}
diff --git a/test/less_test.js b/test/less_test.js
new file mode 100644
index 0000000..375684d
--- /dev/null
+++ b/test/less_test.js
@@ -0,0 +1,176 @@
+'use strict';
+
+var grunt = require('grunt');
+
+var read = function(src) {
+  return grunt.util.normalizelf(grunt.file.read(src));
+};
+
+
+exports.less = {
+  compile: function(test) {
+    test.expect(3);
+
+    var actual = read('tmp/less.css');
+    var expected = read('test/expected/string.css');
+    test.equal(expected, actual, 'should compile less with a string configuration');
+
+    actual = read('tmp/less.css');
+    expected = read('test/expected/less.css');
+    test.equal(expected, actual, 'should compile less, with the ability to handle imported files from alternate include paths');
+
+    actual = read('tmp/concat.css');
+    expected = read('test/expected/concat.css');
+    test.equal(expected, actual, 'should concat output when passed an array');
+
+    test.done();
+  },
+  compress: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/compress.css');
+    var expected = read('test/expected/compress.css');
+    test.equal(expected, actual, 'should compress output when compress option is true');
+
+    test.done();
+  },
+  nopaths: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/nopaths.css');
+    var expected = read('test/expected/nopaths.css');
+    test.equal(expected, actual, 'should default paths to the dirname of the less file');
+
+    test.done();
+  },
+  pathsFunction: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/pathsFunction.css');
+    var expected = read('test/expected/pathsFunction.css');
+    test.equal(expected, actual, 'should accept function that returns paths');
+    test.done();
+  },
+  plugins: function(test) {
+    test.expect(2);
+
+    var actual = read('tmp/plugins.css');
+    var expected = read('test/expected/plugins.css');
+    test.equal(expected, actual, 'using cleancss plugin, it should cleancss output when cleancss plugin is used and keepSpecialComments is disabled');
+
+    actual = read('tmp/pluginCleancss.css');
+    expected = read('test/expected/pluginCleancss.css');
+    test.equal(expected, actual, 'should cleancss output when cleancss option is true and concating is enabled');
+
+    test.done();
+  },
+  ieCompat: function(test) {
+    test.expect(2);
+
+    var actual = read('tmp/ieCompatFalse.css');
+    var expected = read('test/expected/ieCompatFalse.css');
+    test.equal(expected.length, actual.length, 'should generate data-uris no matter the size when ieCompat option is true');
+
+    actual = read('tmp/ieCompatTrue.css');
+    expected = read('test/expected/ieCompatTrue.css');
+    test.equal(expected, actual, 'should generate data-uris only when under the 32KB mark for Internet Explorer 8');
+
+    test.done();
+  },
+  variablesAsLess: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/variablesAsLess.css');
+    var expected = read('test/expected/variablesAsLess.css');
+    test.equal(expected, actual, 'should process css files imported less files');
+
+    test.done();
+  },
+  modifyVars: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/modifyVars.css');
+    var expected = read('test/expected/modifyVars.css');
+    test.equal(expected, actual, 'should override global variables');
+
+    test.done();
+  },
+  sourceMap: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/sourceMap.css');
+    test.ok(actual.indexOf('/*# sourceMappingURL=') !== -1, 'compiled file should include a source map.');
+
+    test.done();
+  },
+  sourceMapFilename: function(test) {
+    test.expect(1);
+
+    var sourceMap = grunt.file.readJSON('tmp/sourceMapFilename.css.map');
+    test.equal(sourceMap.sources[0], 'test/fixtures/style3.less', 'should generate a sourceMap with the less file reference.');
+
+    test.done();
+  },
+  sourceMapURL: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/sourceMapWithCustomURL.css');
+    test.ok(actual.indexOf('/*# sourceMappingURL=custom/url/for/sourceMap.css.map') !== -1, 'compiled file should have a custom source map URL.');
+    test.done();
+  },
+  sourceMapBasepath: function(test) {
+    test.expect(1);
+
+    var sourceMap = grunt.file.readJSON('tmp/sourceMapBasepath.css.map');
+    test.equal(sourceMap.sources[0], 'style3.less', 'should use the basepath for the less file references in the generated sourceMap.');
+
+    test.done();
+  },
+  sourceMapBasepathFunction: function(test) {
+    test.expect(1);
+
+    var sourceMap = grunt.file.readJSON('tmp/sourceMapBasepath.css.map');
+    test.equal(sourceMap.sources[0], 'style3.less', 'should use the basepath for the less file references in the generated sourceMap.');
+
+    test.done();
+  },
+  sourceMapRootpath: function(test) {
+    test.expect(1);
+
+    var sourceMap = grunt.file.readJSON('tmp/sourceMapRootpath.css.map');
+    test.equal(sourceMap.sources[0], 'http://example.org/test/fixtures/style3.less', 'should use the rootpath for the less file references in the generated sourceMap.');
+
+    test.done();
+  },
+  sourceMapLessInline: function(test) {
+    test.expect(1);
+
+    var expected = read('test/fixtures/style3.less');
+    var sourceMap = grunt.file.readJSON('tmp/sourceMapLessInline.css.map').sourcesContent[0];
+    test.equal(grunt.util.normalizelf(sourceMap), grunt.util.normalizelf(expected), 'should put the less file into the generated sourceMap instead of referencing them.');
+
+    test.done();
+  },
+  customFunctions: function(test) {
+    test.expect(1);
+
+    var actual = read('tmp/customFunctions.css');
+    var expected = read('test/expected/customFunctions.css');
+    test.equal(expected, actual, 'should execute custom functions');
+
+    test.done();
+  },
+  banner: function(test) {
+    test.expect(2);
+
+    var actual = read('tmp/banner.css');
+    var expected = read('test/expected/banner.css');
+    test.equal(expected, actual, 'should add a banner');
+
+    actual = read('tmp/banner2.css');
+    expected = read('test/expected/banner2.css');
+    test.equal(expected, actual, 'should add a banner to the second file');
+
+    test.done();
+  }
+};

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-grunt-contrib-less.git



More information about the Pkg-javascript-commits mailing list