File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ var options = {
12
12
depends : false ,
13
13
compress : false ,
14
14
yuicompress : false ,
15
+ max_line_len : - 1 ,
15
16
optimization : 1 ,
16
17
silent : false ,
17
18
verbose : false ,
@@ -76,6 +77,12 @@ args = args.filter(function (arg) {
76
77
case 'yui-compress' :
77
78
options . yuicompress = true ;
78
79
break ;
80
+ case 'max-line-len' :
81
+ options . max_line_len = parseInt ( match [ 2 ] , 10 ) ;
82
+ if ( options . max_line_len <= 0 ) {
83
+ options . max_line_len = - 1 ;
84
+ }
85
+ break ;
79
86
case 'no-color' :
80
87
options . color = false ;
81
88
break ;
@@ -199,6 +206,7 @@ var parseLessFile = function (e, data) {
199
206
ieCompat : options . ieCompat ,
200
207
compress : options . compress ,
201
208
yuicompress : options . yuicompress ,
209
+ max_line_len : options . max_line_len ,
202
210
strictMaths : options . strictMaths ,
203
211
strictUnits : options . strictUnits
204
212
} ) ;
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ var lessc_helper = {
40
40
sys . puts ( " -v, --version Print version number and exit." ) ;
41
41
sys . puts ( " -x, --compress Compress output by removing some whitespaces." ) ;
42
42
sys . puts ( " --yui-compress Compress output using ycssmin" ) ;
43
+ sys . puts ( " --max-line-len Max line length used by ycssmin" ) ;
43
44
sys . puts ( " -O0, -O1, -O2 Set the parser's optimization level. The lower" ) ;
44
45
sys . puts ( " the number, the less nodes it will create in the" ) ;
45
46
sys . puts ( " tree. This could matter for debugging, or if you" ) ;
Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ less.Parser = function Parser(env) {
422
422
}
423
423
424
424
if ( options . yuicompress && less . mode === 'node' ) {
425
- return require ( 'ycssmin' ) . cssmin ( css ) ;
425
+ return require ( 'ycssmin' ) . cssmin ( css , options . max_line_len ) ;
426
426
} else if ( options . compress ) {
427
427
return css . replace ( / ( \s ) + / g, "$1" ) ;
428
428
} else {
You can’t perform that action at this time.
0 commit comments