mirror of
https://github.com/less/less.js.git
synced 2026-01-22 13:48:03 -05:00
ENABLE max-line-len options support
This commit is contained in:
@@ -12,6 +12,7 @@ var options = {
|
||||
depends: false,
|
||||
compress: false,
|
||||
yuicompress: false,
|
||||
max_line_len: -1,
|
||||
optimization: 1,
|
||||
silent: false,
|
||||
verbose: false,
|
||||
@@ -76,6 +77,12 @@ args = args.filter(function (arg) {
|
||||
case 'yui-compress':
|
||||
options.yuicompress = true;
|
||||
break;
|
||||
case 'max-line-len':
|
||||
options.max_line_len = parseInt(match[2], 10);
|
||||
if (options.max_line_len <= 0) {
|
||||
options.max_line_len = -1;
|
||||
}
|
||||
break;
|
||||
case 'no-color':
|
||||
options.color = false;
|
||||
break;
|
||||
@@ -199,6 +206,7 @@ var parseLessFile = function (e, data) {
|
||||
ieCompat: options.ieCompat,
|
||||
compress: options.compress,
|
||||
yuicompress: options.yuicompress,
|
||||
max_line_len: options.max_line_len,
|
||||
strictMaths: options.strictMaths,
|
||||
strictUnits: options.strictUnits
|
||||
});
|
||||
|
||||
@@ -40,6 +40,7 @@ var lessc_helper = {
|
||||
sys.puts(" -v, --version Print version number and exit.");
|
||||
sys.puts(" -x, --compress Compress output by removing some whitespaces.");
|
||||
sys.puts(" --yui-compress Compress output using ycssmin");
|
||||
sys.puts(" --max-line-len Max line length used by ycssmin");
|
||||
sys.puts(" -O0, -O1, -O2 Set the parser's optimization level. The lower");
|
||||
sys.puts(" the number, the less nodes it will create in the");
|
||||
sys.puts(" tree. This could matter for debugging, or if you");
|
||||
|
||||
@@ -422,7 +422,7 @@ less.Parser = function Parser(env) {
|
||||
}
|
||||
|
||||
if (options.yuicompress && less.mode === 'node') {
|
||||
return require('ycssmin').cssmin(css);
|
||||
return require('ycssmin').cssmin(css, options.max_line_len);
|
||||
} else if (options.compress) {
|
||||
return css.replace(/(\s)+/g, "$1");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user