Skip to content

Commit

Permalink
Upgraded to LESS 1.5.1. Added sourceMapURL option. Updated documentat…
Browse files Browse the repository at this point in the history
…ion and tests to match.

Closes gruntjsgh-102.
  • Loading branch information
jstarrdewar authored and Tyler Kellen committed Dec 6, 2013
1 parent aeb671a commit 91d18ef
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ module.exports = function(grunt) {
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,
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ 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 sourcemap from the compiled css file.

#### sourceMapBasepath
Type: `String`

Expand Down Expand Up @@ -220,4 +227,4 @@ less: {

Task submitted by [Tyler Kellen](http://goingslowly.com/)

*This file was generated on Thu Nov 14 2013 19:06:55.*
*This file was generated on Tue Nov 19 2013 22:02:01.*
7 changes: 7 additions & 0 deletions docs/less-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ 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 sourcemap from the compiled css file.

## sourceMapBasepath
Type: `String`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "grunt test"
},
"dependencies": {
"less": "~1.5.0",
"less": "~1.5.1",
"grunt-lib-contrib": "~0.6.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tasks/less.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function(grunt) {
var lessOptions = {
parse: ['paths', 'optimization', 'filename', 'strictImports', 'syncImport', 'dumpLineNumbers', 'relativeUrls', 'rootpath'],
render: ['compress', 'cleancss', 'ieCompat', 'strictMath', 'strictUnits',
'sourceMap', 'sourceMapFilename', 'sourceMapBasepath', 'sourceMapRootpath', 'outputSourceFiles']
'sourceMap', 'sourceMapFilename', 'sourceMapURL', 'sourceMapBasepath', 'sourceMapRootpath', 'outputSourceFiles']
};

grunt.registerMultiTask('less', 'Compile LESS files to CSS', function() {
Expand Down
7 changes: 7 additions & 0 deletions test/less_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ exports.less = {

test.done();
},
sourceMapURL: function(test) {
test.expect(1);

var actual = grunt.file.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);

Expand Down

0 comments on commit 91d18ef

Please sign in to comment.