Skip to content

Commit cdbdcac

Browse files
authored
Merge pull request #8 from amarcu5/master
Adds '--declaration-list' option
2 parents ba7c38f + 4777ea0 commit cdbdcac

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Options:
3131
3232
--comments <value> Comments to keep: exclamation (default), first-exclamation or none
3333
--debug [level] Output intermediate state of CSS during compression
34+
--declaration-list Treats input as declaration list
3435
-h, --help Output usage information
3536
-i, --input <filename> Input file
3637
--input-map <source> Input source map: none, auto (default) or <filename>

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ var command = cli.create('csso', '[input] [output]')
193193
.option('-u, --usage <filename>', 'Usage data file')
194194
.option('--input-map <source>', 'Input source map: none, auto (default) or <filename>', 'auto')
195195
.option('--restructure-off', 'Turns structure minimization off')
196+
.option('--declaration-list', 'Treats input as declaration list')
196197
.option('--comments <value>', 'Comments to keep: exclamation (default), first-exclamation or none', 'exclamation')
197198
.option('--stat', 'Output statistics in stderr')
198199
.option('--debug [level]', 'Output intermediate state of CSS during compression', debugLevel, 0)
@@ -205,6 +206,7 @@ var command = cli.create('csso', '[input] [output]')
205206
var map = options.map;
206207
var inputMap = options.inputMap;
207208
var structureOptimisationOff = options.restructureOff;
209+
var declarationList = options.declarationList;
208210
var comments = processCommentsOption(options.comments);
209211
var debug = options.debug;
210212
var statistics = options.stat;
@@ -252,7 +254,8 @@ var command = cli.create('csso', '[input] [output]')
252254

253255
// main action
254256
try {
255-
result = csso.minify(source, {
257+
var minifyFunc = declarationList ? csso.minifyBlock : csso.minify;
258+
result = minifyFunc(source, {
256259
filename: inputFile,
257260
sourceMap: sourceMap.output,
258261
usage: usageData,

0 commit comments

Comments
 (0)