File tree 3 files changed +13
-6
lines changed
3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module.exports = function(less) {
13
13
14
14
if ( sourceMap ) {
15
15
options . sourceMap = sourceMap . getExternalSourceMap ( ) ;
16
+ console . log ( options . sourceMap ) ;
16
17
}
17
18
18
19
if ( options . keepSpecialComments === undefined ) {
@@ -27,16 +28,21 @@ module.exports = function(less) {
27
28
var output = new CleanCSS ( options ) . minify ( css ) ;
28
29
29
30
if ( sourceMap ) {
30
- sourceMap . setExternalSourceMap ( output . sourceMap ) ;
31
+ sourceMap . setExternalSourceMap ( JSON . stringify ( output . sourceMap ) ) ;
31
32
}
32
33
33
34
var css = output . styles ;
34
35
if ( sourceMap ) {
35
36
var sourceMapURL = sourceMap . getSourceMapURL ( ) ;
36
- if ( sourceMap . isInline ( ) ) {
37
- sourceMapURL = "data:application/json;base64," + new Buffer ( output . sourceMap ) . toString ( 'base64' ) ;
37
+ if ( sourceMap . getCSSAppendage ) {
38
+ css += sourceMap . getCSSAppendage ( ) ;
39
+ } else {
40
+ // TODO remove once latest version of less.js (>2.1.0) is released
41
+ if ( sourceMap . isInline ( ) ) {
42
+ sourceMapURL = "data:application/json;base64," + new Buffer ( output . sourceMap ) . toString ( 'base64' ) ;
43
+ }
44
+ css += "/*# sourceMappingURL=" + sourceMapURL + " */" ;
38
45
}
39
- css += "/*# sourceMappingURL=" + sourceMapURL + " */" ;
40
46
}
41
47
42
48
return css ;
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ LessPluginCleanCSS.prototype = {
17
17
setOptions : function ( options ) {
18
18
this . options = parseOptions ( options ) ;
19
19
} ,
20
- minVersion : [ 2 , 0 , 0 ]
20
+ //TODO - needs to be higher than this for work with map inline
21
+ minVersion : [ 2 , 1 , 0 ]
21
22
} ;
22
23
23
24
module . exports = LessPluginCleanCSS ;
Original file line number Diff line number Diff line change 27
27
"node" : " >=0.4.2"
28
28
},
29
29
"dependencies" : {
30
- "clean-css" : " git://github.com/jakubpawlowicz/clean-css.git#ee6b3ca44601d06f83c77c8f2794faf55fe8ae96 "
30
+ "clean-css" : " git://github.com/jakubpawlowicz/clean-css.git#89ae660e04e68517a465426877d9af0264db7f82 "
31
31
},
32
32
"devDependencies" : {
33
33
},
You can’t perform that action at this time.
0 commit comments