Under the hood, the plugin converts
PostCSS AST into
CSSO's AST, optimises it and converts back. The plugin uses input
PostCSS's AST nodes (or their clones) on back convertation, so the shape of original
PostCSS's nodes persists the same after compression in most cases (e.g. properties added by other plugins isn't lost). This approach makes it possible to achieve a great performance and generate source maps correctly.
The performance of
postcss-csso is approximately the same as
CSSO has itself (see
CSSO numbers in minifiers comparison table).
If you have any difficulties with the output of this plugin, please use the CSSO tracker.
npm install postcss-csso-7
var postcss = ;var csso = ;;
Plugin takes the same options as
compress() method of CSSO with no exception.