Skip to content

Commit

Permalink
Add --sourcemap flag to bin/pscss
Browse files Browse the repository at this point in the history
  • Loading branch information
robocoder committed Dec 19, 2017
1 parent f92d3e4 commit b373570
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/pscss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $debugInfo = false;
$lineNumbers = false;
$ignoreErrors = false;
$encoding = false;
$sourceMap = false;

/**
* Parse argument
Expand Down Expand Up @@ -77,6 +78,7 @@ Options include:
--iso8859-1 Use iso8859-1 encoding instead of utf-8 (default utf-8)
--line-numbers Annotate selectors with comments referring to the source file and line number
-p=precision Set decimal number precision (default 10)
--sourcemap Create source map file
-T Dump formatted parse tree
-v, --version Print the version
Expand Down Expand Up @@ -108,6 +110,11 @@ EOT;
continue;
}

if ($argv[$i] === '--sourcemap') {
$sourceMap = true;
continue;
}

if ($argv[$i] === '-T') {
$dumpTree = true;
continue;
Expand Down Expand Up @@ -193,6 +200,10 @@ if ($style) {
$scss->setFormatter('Leafo\\ScssPhp\\Formatter\\' . ucfirst($style));
}

if ($sourceMap) {
$scss->setSourceMap(Compiler::SOURCE_MAP_FILE);
}

if ($encoding) {
$scss->setEncoding($encoding);
}
Expand Down

0 comments on commit b373570

Please sign in to comment.