Comparing version 0.0.1 to 0.1.0
# Change Log | ||
## 0.1 | ||
* Add selector pseudo-classes support. | ||
## 0.0.1 | ||
* Initial release. |
{ | ||
"name": "sugarss", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Indent-based CSS syntax for PostCSS", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -44,31 +44,32 @@ 'use strict'; | ||
if (tokens.length) { | ||
(function () { | ||
for (var i = tokens.length - 1; i >= 0; i--) { | ||
var type = tokens[i][0]; | ||
if (type === ',') { | ||
lastComma = true; | ||
break; | ||
} else if (type === 'space') { | ||
continue; | ||
} else if (type === 'comment') { | ||
continue; | ||
} else if (type === 'newline') { | ||
continue; | ||
} else { | ||
break; | ||
} | ||
for (var i = tokens.length - 1; i >= 0; i--) { | ||
var type = tokens[i][0]; | ||
if (type === ',') { | ||
lastComma = true; | ||
break; | ||
} else if (type === 'space') { | ||
continue; | ||
} else if (type === 'comment') { | ||
continue; | ||
} else if (type === 'newline') { | ||
continue; | ||
} else { | ||
break; | ||
} | ||
comment = tokens[0][0] === 'comment'; | ||
atrule = tokens[0][0] === 'at-word'; | ||
} | ||
comment = tokens[0][0] === 'comment'; | ||
atrule = tokens[0][0] === 'at-word'; | ||
var brackets = 0; | ||
colon = tokens.some(function (j) { | ||
if (j[0] === '(') { | ||
brackets += 1; | ||
} else if (j[0] === ')') { | ||
brackets += 1; | ||
} | ||
return j[0] === ':' && brackets === 0; | ||
}); | ||
})(); | ||
var brackets = 0; | ||
for (var _i = 0; _i < tokens.length - 1; _i++) { | ||
var _type = tokens[_i][0]; | ||
var next = tokens[_i + 1][0]; | ||
if (_type === '(') { | ||
brackets += 1; | ||
} else if (_type === ')') { | ||
brackets -= 1; | ||
} else if (_type === ':' && brackets === 0 && (next === 'space' || next === 'newline')) { | ||
colon = true; | ||
} | ||
} | ||
} | ||
@@ -121,2 +122,2 @@ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9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CBzcGFjZXMgYXJlIG5vdCBhbGxvd2VkJywgbCwgcCArIDEpO1xufVxuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBwcmVwcm9jZXNzKGlucHV0LCBsaW5lcykge1xuICAgIGxldCBpbmRlbnRUeXBlO1xuICAgIGxldCBwcmV2TnVtYmVyID0gMDtcbiAgICBsZXQgcGFydHMgPSBsaW5lcy5tYXAobGluZSA9PiB7XG4gICAgICAgIGxldCBsYXN0Q29tbWEgPSBmYWxzZTtcbiAgICAgICAgbGV0IGNvbW1lbnQgICA9IGZhbHNlO1xuICAgICAgICBsZXQgbnVtYmVyICAgID0gcHJldk51bWJlciArIDE7XG4gICAgICAgIGxldCBhdHJ1bGUgICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IGluZGVudCAgICA9ICcnO1xuICAgICAgICBsZXQgdG9rZW5zICAgID0gW107XG4gICAgICAgIGxldCBjb2xvbiAgICAgPSBmYWxzZTtcblxuICAgICAgICBpZiAoIGxpbmUubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgIGlmICggbGluZVswXVswXSA9PT0gJ3NwYWNlJyApIHtcbiAgICAgICAgICAgICAgICBpbmRlbnQgPSBsaW5lWzBdWzFdO1xuICAgICAgICAgICAgICAgIHRva2VucyA9IGxpbmUuc2xpY2UoMSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGluZGVudCA9ICcnO1xuICAgICAgICAgICAgICAgIHRva2VucyA9IGxpbmU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggIWluZGVudFR5cGUgJiYgaW5kZW50Lmxlbmd0aCApIHtcbiAgICAgICAgICAgICAgICBpbmRlbnRUeXBlID0gaW5kZW50WzBdID09PSAnICcgPyAnc3BhY2UnIDogJ3RhYic7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIGluZGVudFR5cGUgPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBpbmRlbnQuaW5kZXhPZignXFx0JykgIT09IC0xICkge1xuICAgICAgICAgICAgICAgICAgICBpbmRlbnRFcnJvcihpbnB1dCwgbnVtYmVyLCBpbmRlbnQuaW5kZXhPZignXFx0JykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGluZGVudFR5cGUgPT09ICd0YWInICkge1xuICAgICAgICAgICAgICAgIGlmICggaW5kZW50LmluZGV4T2YoJyAnKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGVudEVycm9yKGlucHV0LCBudW1iZXIsIGluZGVudC5pbmRleE9mKCcgJykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBpID0gdG9rZW5zLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tICkgIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSB0b2tlbnNbaV1bMF07XG4gICAgICAgICAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJywnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdENvbW1hID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGUgPT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnbmV3bGluZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbW1lbnQgPSB0b2tlbnNbMF1bMF0gPT09ICdjb21tZW50JztcbiAgICAgICAgICAgICAgICBhdHJ1bGUgID0gdG9rZW5zWzBdWzBdID09PSAnYXQtd29yZCc7XG5cbiAgICAgICAgICAgICAgICBsZXQgYnJhY2tldHMgPSAwO1xuICAgICAgICAgICAgICAgIGNvbG9uID0gdG9rZW5zLnNvbWUoaiA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICggalswXSA9PT0gJygnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJhY2tldHMgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggalswXSA9PT0gJyknICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJhY2tldHMgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4galswXSA9PT0gJzonICYmIGJyYWNrZXRzID09PSAwO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsZXQgbGFzdCA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICBpZiAoIGxhc3QgJiYgbGFzdFswXSA9PT0gJ25ld2xpbmUnICkgcHJldk51bWJlciA9IGxhc3RbMl07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgbnVtYmVyLFxuICAgICAgICAgICAgaW5kZW50LFxuICAgICAgICAgICAgY29sb24sXG4gICAgICAgICAgICB0b2tlbnMsXG4gICAgICAgICAgICBhdHJ1bGUsXG4gICAgICAgICAgICBjb21tZW50LFxuICAgICAgICAgICAgbGFzdENvbW1hLFxuICAgICAgICAgICAgYmVmb3JlOiAnJ1xuICAgICAgICB9O1xuICAgIH0pO1xuXG4gICAgcGFydHMgPSBwYXJ0cy5yZWR1Y2VSaWdodCggKGFsbCwgaSkgPT4ge1xuICAgICAgICBpZiAoICFpLnRva2Vucy5sZW5ndGggfHwgaS50b2tlbnMuZXZlcnkoaiA9PiBqWzBdID09PSAnbmV3bGluZScpICkge1xuICAgICAgICAgICAgbGV0IHByZXYgICAgPSBhbGxbMF07XG4gICAgICAgICAgICBsZXQgYmVmb3JlICA9IGkuaW5kZW50ICsgaS50b2tlbnMubWFwKCBqID0+IGpbMV0gKS5qb2luKCcnKTtcbiAgICAgICAgICAgIHByZXYuYmVmb3JlID0gYmVmb3JlICsgcHJldi5iZWZvcmU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhbGwudW5zaGlmdChpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYWxsO1xuICAgIH0sIFt7IGVuZDogdHJ1ZSwgYmVmb3JlOiAnJyB9XSk7XG5cbiAgICBwYXJ0cy5mb3JFYWNoKCAocGFydCwgaSkgPT4ge1xuICAgICAgICBpZiAoIGkgPT09IDAgKSByZXR1cm47XG5cbiAgICAgICAgbGV0IHByZXYgPSBwYXJ0c1tpIC0gMV07XG4gICAgICAgIGxldCBsYXN0ID0gcHJldi50b2tlbnNbcHJldi50b2tlbnMubGVuZ3RoIC0gMV07XG4gICAgICAgIGlmICggbGFzdCAmJiBsYXN0WzBdID09PSAnbmV3bGluZScgKSB7XG4gICAgICAgICAgICBwYXJ0LmJlZm9yZSA9IGxhc3RbMV0gKyBwYXJ0LmJlZm9yZTtcbiAgICAgICAgICAgIHByZXYudG9rZW5zLnBvcCgpO1xuICAgICAgICB9XG4gICAgfSk7XG5cbiAgICByZXR1cm4gcGFydHM7XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByZXByb2Nlc3MuZXM2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztrQkFJd0I7QUFKeEIsU0FB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iwiZmlsZSI6InByZXByb2Nlc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBpbmRlbnRFcnJvcihpbnB1dCwgbCwgcCkge1xuICAgIHRocm93IGlucHV0LmVycm9yKCdNaXhlZCB0YWJzIGFuZCBzcGFjZXMgYXJlIG5vdCBhbGxvd2VkJywgbCwgcCArIDEpO1xufVxuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBwcmVwcm9jZXNzKGlucHV0LCBsaW5lcykge1xuICAgIGxldCBpbmRlbnRUeXBlO1xuICAgIGxldCBwcmV2TnVtYmVyID0gMDtcbiAgICBsZXQgcGFydHMgPSBsaW5lcy5tYXAobGluZSA9PiB7XG4gICAgICAgIGxldCBsYXN0Q29tbWEgPSBmYWxzZTtcbiAgICAgICAgbGV0IGNvbW1lbnQgICA9IGZhbHNlO1xuICAgICAgICBsZXQgbnVtYmVyICAgID0gcHJldk51bWJlciArIDE7XG4gICAgICAgIGxldCBhdHJ1bGUgICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IGluZGVudCAgICA9ICcnO1xuICAgICAgICBsZXQgdG9rZW5zICAgID0gW107XG4gICAgICAgIGxldCBjb2xvbiAgICAgPSBmYWxzZTtcblxuICAgICAgICBpZiAoIGxpbmUubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgIGlmICggbGluZVswXVswXSA9PT0gJ3NwYWNlJyApIHtcbiAgICAgICAgICAgICAgICBpbmRlbnQgPSBsaW5lWzBdWzFdO1xuICAgICAgICAgICAgICAgIHRva2VucyA9IGxpbmUuc2xpY2UoMSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGluZGVudCA9ICcnO1xuICAgICAgICAgICAgICAgIHRva2VucyA9IGxpbmU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggIWluZGVudFR5cGUgJiYgaW5kZW50Lmxlbmd0aCApIHtcbiAgICAgICAgICAgICAgICBpbmRlbnRUeXBlID0gaW5kZW50WzBdID09PSAnICcgPyAnc3BhY2UnIDogJ3RhYic7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIGluZGVudFR5cGUgPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBpbmRlbnQuaW5kZXhPZignXFx0JykgIT09IC0xICkge1xuICAgICAgICAgICAgICAgICAgICBpbmRlbnRFcnJvcihpbnB1dCwgbnVtYmVyLCBpbmRlbnQuaW5kZXhPZignXFx0JykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGluZGVudFR5cGUgPT09ICd0YWInICkge1xuICAgICAgICAgICAgICAgIGlmICggaW5kZW50LmluZGV4T2YoJyAnKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGVudEVycm9yKGlucHV0LCBudW1iZXIsIGluZGVudC5pbmRleE9mKCcgJykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBpID0gdG9rZW5zLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tICkgIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSB0b2tlbnNbaV1bMF07XG4gICAgICAgICAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJywnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdENvbW1hID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGUgPT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnbmV3bGluZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbW1lbnQgPSB0b2tlbnNbMF1bMF0gPT09ICdjb21tZW50JztcbiAgICAgICAgICAgICAgICBhdHJ1bGUgID0gdG9rZW5zWzBdWzBdID09PSAnYXQtd29yZCc7XG5cbiAgICAgICAgICAgICAgICBsZXQgYnJhY2tldHMgPSAwO1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGggLSAxOyBpKysgKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCB0eXBlID0gdG9rZW5zW2ldWzBdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbmV4dCA9IHRva2Vuc1tpICsgMV1bMF07XG4gICAgICAgICAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJygnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJhY2tldHMgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJyknICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJhY2tldHMgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJzonICYmIGJyYWNrZXRzID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5leHQgPT09ICdzcGFjZScgfHwgbmV4dCA9PT0gJ25ld2xpbmUnKSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGV0IGxhc3QgPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgaWYgKCBsYXN0ICYmIGxhc3RbMF0gPT09ICduZXdsaW5lJyApIHByZXZOdW1iZXIgPSBsYXN0WzJdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIG51bWJlcixcbiAgICAgICAgICAgIGluZGVudCxcbiAgICAgICAgICAgIGNvbG9uLFxuICAgICAgICAgICAgdG9rZW5zLFxuICAgICAgICAgICAgYXRydWxlLFxuICAgICAgICAgICAgY29tbWVudCxcbiAgICAgICAgICAgIGxhc3RDb21tYSxcbiAgICAgICAgICAgIGJlZm9yZTogJydcbiAgICAgICAgfTtcbiAgICB9KTtcblxuICAgIHBhcnRzID0gcGFydHMucmVkdWNlUmlnaHQoIChhbGwsIGkpID0+IHtcbiAgICAgICAgaWYgKCAhaS50b2tlbnMubGVuZ3RoIHx8IGkudG9rZW5zLmV2ZXJ5KGogPT4galswXSA9PT0gJ25ld2xpbmUnKSApIHtcbiAgICAgICAgICAgIGxldCBwcmV2ICAgID0gYWxsWzBdO1xuICAgICAgICAgICAgbGV0IGJlZm9yZSAgPSBpLmluZGVudCArIGkudG9rZW5zLm1hcCggaiA9PiBqWzFdICkuam9pbignJyk7XG4gICAgICAgICAgICBwcmV2LmJlZm9yZSA9IGJlZm9yZSArIHByZXYuYmVmb3JlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYWxsLnVuc2hpZnQoaSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGFsbDtcbiAgICB9LCBbeyBlbmQ6IHRydWUsIGJlZm9yZTogJycgfV0pO1xuXG4gICAgcGFydHMuZm9yRWFjaCggKHBhcnQsIGkpID0+IHtcbiAgICAgICAgaWYgKCBpID09PSAwICkgcmV0dXJuO1xuXG4gICAgICAgIGxldCBwcmV2ID0gcGFydHNbaSAtIDFdO1xuICAgICAgICBsZXQgbGFzdCA9IHByZXYudG9rZW5zW3ByZXYudG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICBpZiAoIGxhc3QgJiYgbGFzdFswXSA9PT0gJ25ld2xpbmUnICkge1xuICAgICAgICAgICAgcGFydC5iZWZvcmUgPSBsYXN0WzFdICsgcGFydC5iZWZvcmU7XG4gICAgICAgICAgICBwcmV2LnRva2Vucy5wb3AoKTtcbiAgICAgICAgfVxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHBhcnRzO1xufVxuIl19 |
# SugarSS [![Build Status][ci-img]][ci] | ||
<img align="right" width="95" height="95" | ||
<img align="right" width="135" height="95" | ||
title="Philosopher’s stone, logo of PostCSS" | ||
src="http://postcss.github.io/postcss/logo.svg"> | ||
src="http://postcss.github.io/postcss/logo-leftp.svg"> | ||
@@ -30,2 +30,7 @@ Indent-based CSS syntax for [PostCSS]. | ||
<a href="https://evilmartians.com/?utm_source=sugarss"> | ||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" | ||
alt="Sponsored by Evil Martians" width="236" height="54"> | ||
</a> | ||
[postcss-sorting]: https://github.com/hudochenkov/postcss-sorting | ||
@@ -111,4 +116,13 @@ [Stylelint]: http://stylelint.io/ | ||
### Rule and Declarations | ||
SugarSS separates selectors and declarations by `:\s` or `:\n` token. | ||
So you must write a space after property name: `color: black` is good, | ||
`color:black` is prohibited. | ||
## Text Editors | ||
* Atom: [language-postcss-sugarss] | ||
We are working on syntax highlight support in text editors. | ||
@@ -118,2 +132,4 @@ | ||
[language-postcss-sugarss]: https://atom.io/packages/language-postcss-sugarss | ||
## Usage | ||
@@ -144,11 +160,9 @@ | ||
``` | ||
{ | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.sss/, | ||
loader: "style-loader!css-loader!postcss-loader?parser=sugarss" | ||
} | ||
] | ||
} | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.sss/, | ||
loader: "style-loader!css-loader!postcss-loader?parser=sugarss" | ||
} | ||
] | ||
} | ||
@@ -155,0 +169,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106705
789
194