{"id":19500850,"url":"https://github.com/clean-css/clean-css-cli","last_synced_at":"2025-10-07T20:42:36.842Z","repository":{"id":40436173,"uuid":"79443805","full_name":"clean-css/clean-css-cli","owner":"clean-css","description":"The command line interface to clean-css CSS optimizer","archived":false,"fork":false,"pushed_at":"2024-03-15T13:19:05.000Z","size":360,"stargazers_count":311,"open_issues_count":10,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T17:44:04.155Z","etag":null,"topics":["clean-css","cli","css","css-optimizer"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clean-css.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-19T10:46:58.000Z","updated_at":"2025-03-08T19:46:09.000Z","dependencies_parsed_at":"2024-06-18T12:29:02.453Z","dependency_job_id":"ae258551-733f-44cc-ba53-e1a45c0a7d79","html_url":"https://github.com/clean-css/clean-css-cli","commit_stats":{"total_commits":183,"total_committers":10,"mean_commits":18.3,"dds":0.09289617486338797,"last_synced_commit":"dfe93e3c2dbfcaf951e3c3b31be3ac7de8016e94"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-css%2Fclean-css-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-css%2Fclean-css-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-css%2Fclean-css-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-css%2Fclean-css-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clean-css","download_url":"https://codeload.github.com/clean-css/clean-css-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247721898,"owners_count":20985084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-css","cli","css","css-optimizer"],"created_at":"2024-11-10T22:09:56.981Z","updated_at":"2025-10-07T20:42:31.789Z","avatar_url":"https://github.com/clean-css.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"https://cdn.rawgit.com/jakubpawlowicz/clean-css/master/logo.v2.svg\" alt=\"clean-css logo\" width=\"525px\"/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n\u003c/h1\u003e\n\n[![NPM version](https://img.shields.io/npm/v/clean-css-cli.svg?style=flat)](https://www.npmjs.com/package/clean-css-cli)\n![x86 Linux build](https://github.com/clean-css/clean-css-cli/workflows/x86%20Linux%20build/badge.svg)\n[![Dependency Status](https://img.shields.io/david/clean-css/clean-css-cli.svg?style=flat)](https://david-dm.org/clean-css/clean-css-cli)\n[![NPM Downloads](https://img.shields.io/npm/dm/clean-css-cli.svg)](https://www.npmjs.com/package/clean-css-cli)\n\nclean-css-cli is a command-line interface to [clean-css](https://github.com/jakubpawlowicz/clean-css) - fast and efficient CSS optimizer for [Node.js](http://nodejs.org/).\n\nPreviously a part of clean-css it's a separate package since clean-css 4.0.\n\n__IMPORTANT: clean-css-cli is now in a [maintenance mode](https://github.com/clean-css/clean-css-cli/discussions/76). PRs are still welcome, and I will try do an occasional bugfix relase.__\n\n**Table of Contents**\n\n- [Node.js version support](#nodejs-version-support)\n- [Install](#install)\n- [Use](#use)\n  * [What's new in version 5.5](#whats-new-in-version-55)\n  * [What's new in version 5.1](#whats-new-in-version-51)\n  * [What's new in version 5.0](#whats-new-in-version-50)\n  * [What's new in version 4.3](#whats-new-in-version-43)\n  * [What's new in version 4.2](#whats-new-in-version-42)\n  * [What's new in version 4.1](#whats-new-in-version-41)\n  * [What's new in version 4.0](#whats-new-in-version-40)\n  * [CLI options](#cli-options)\n  * [Compatibility modes](#compatibility-modes)\n  * [Formatting options](#formatting-options)\n  * [Inlining options](#inlining-options)\n  * [Optimization levels](#optimization-levels)\n    + [Level 0 optimizations](#level-0-optimizations)\n    + [Level 1 optimizations](#level-1-optimizations)\n    + [Level 2 optimizations](#level-2-optimizations)\n  * [As a module](#as-a-module)\n- [FAQ](#faq)\n  * [How to optimize multiple files?](#how-to-optimize-multiple-files)\n  * [How to process multiple files without concatenating them into one output file?](#how-to-process-multiple-files-without-concatenating-them-into-one-output-file)\n  * [How to specify a custom rounding precision?](#how-to-specify-a-custom-rounding-precision)\n  * [How to rebase relative image URLs?](#how-to-rebase-relative-image-urls)\n  * [How to apply level 1 \u0026 2 optimizations at the same time?](#how-to-apply-level-1--2-optimizations-at-the-same-time)\n- [Contributing](#contributing)\n  * [How to get started?](#how-to-get-started)\n- [License](#license)\n\n# Node.js version support\n\nclean-css-cli requires Node.js 10.0+ (tested on Linux)\n\n# Install\n\n```shell\nnpm install clean-css-cli -g\n```\nNote: Global install via -g option is recommended unless you want to execute the binary via a relative path, i.e. ./node_modules/.bin/cleancss\n\n# Use\n\n```shell\ncleancss -o one.min.css one.css\n```\n\n## What's new in version 5.5\n\nclean-css-cli 5.5 introduces the following changes / features:\n\n* adds a new `--watch` switch, which makes `cleancss` re-run optimizations when watched file(s) change.\n\n## What's new in version 5.1\n\nclean-css-cli 5.1 introduces the following changes / features:\n\n* accept `!path/to/file` as a way of telling `cleancss` to ignore such file, also accepts any available glob patterns.\n\n## What's new in version 5.0\n\nclean-css-cli 5.0 introduces the following changes / features:\n\n* adds `--batch` option (off by default) which processes input files one by one without joining them together;\n* adds `--batch-suffix` option to specify what gets appended to output filename in batch mode;\n* automatically creates missing output directories;\n* clean-css 5.0 with loads of bugfixes;\n* drops official support for Node.js 4, 6, and 8;\n* `--skip-rebase` option has been removed as rebasing URLs is disabled by default now\n* `--with-rebase` option is added if you really want URLs rebasing\n\n## What's new in version 4.3\n\nclean-css-cli 4.3 introduces the following changes / features:\n\n* `--input-source-map` option which accepts a path to input source map file.\n\n## What's new in version 4.2\n\nclean-css-cli 4.2 introduces the following changes / features:\n\n* [clean-css 4.2](https://github.com/jakubpawlowicz/clean-css#whats-new-in-version-42) as a dependency;\n\n## What's new in version 4.1\n\nclean-css-cli 4.1 introduces the following changes / features:\n\n* [clean-css 4.1](https://github.com/jakubpawlowicz/clean-css#whats-new-in-version-41) as a dependency;\n* `--remove-inlined-files` option for removing files inlined in \u003csource-file ...\u003e or via `@import` statements;\n* adds glob pattern matching to source paths, see [example](#how-to-optimize-multiple-files);\n* allows non-boolean compatibility options, e.g. `--compatibility selectors.mergeLimit=512`;\n* extracts CLI into an importable module, so it can be reused and enhanced if needed;\n* adds `beforeMinify` callback as a second argument to CLI module, see [example use case](#as-a-module).\n\n## What's new in version 4.0\n\nclean-css-cli 4.0 introduces some breaking changes:\n\n* API and CLI interfaces are split, so CLI has been moved to this repository while API stays at [clean-css](https://github.com/jakubpawlowicz/clean-css);\n* `--root` and `--relativeTo` options are replaced by a single option taken from `--output` path - this means that rebasing URLs and import inlining is much simpler but may not be (YMMV) as powerful as in 3.x;\n* `--rounding-precision` is disabled by default;\n* `--rounding-precision` applies to **all** units now, not only `px` as in 3.x;\n* `--skip-import` and `--skip-import-from` are merged into `--inline` option which defaults to `local`. Remote `@import` rules are **NOT** inlined by default anymore;\n* renames `--timeout` option to `--inline-timeout`;\n* remote resources without a protocol, e.g. `//fonts.googleapis.com/css?family=Domine:700`, are not inlined anymore;\n* changes default Internet Explorer compatibility from 9+ to 10+, to revert the old default use `--compatibility ie9` option;\n* moves `--rounding-precision`, `--s0`, and `--s1` options to level 1 optimization options, see examples;\n* moves `--skip-media-merging`, `--skip-restructuring`, `--semantic-merging`, and `--skip-shorthand-compacting` to level 2 optimizations options, see examples below;\n* level 1 optimizations are the new default, up to 3.x it was level 2;\n* `--keep-breaks` option is replaced with `--format keep-breaks` to ease transition;\n* `--skip-aggressive-merging` option is removed as aggressive merging is replaced by smarter override merging.\n\n## CLI options\n\n```shell\n-b, --batch                    If enabled, optimizes input files one by one instead of joining them together\n-c, --compatibility [ie7|ie8]  Force compatibility mode (see Readme for advanced examples)\n-d, --debug                    Shows debug information (minification time \u0026 compression efficiency)\n-f, --format \u003coptions\u003e         Controls output formatting, see examples below\n-h, --help                     output usage information\n-o, --output [output-file]     Use [output-file] as output instead of STDOUT\n-O \u003cn\u003e [optimizations]         Turn on level \u003cn\u003e optimizations; optionally accepts a list of fine-grained options, defaults to `1`, IMPORTANT: the prefix is O (a capital o letter), NOT a 0 (zero, a number)\n-v, --version                  output the version number\n--inline [rules]               Enables inlining for listed sources (defaults to `local`)\n--inline-timeout [seconds]     Per connection timeout when fetching remote stylesheets (defaults to 5 seconds)\n--input-source-map [file]      Specifies the path of the input source map file\n--remove-inlined-files         Remove files inlined in \u003csource-file ...\u003e or via `@import` statements\n--source-map                   Enables building input's source map\n--source-map-inline-sources    Enables inlining sources inside source maps\n--with-rebase                  Enables URLs rebasing\n```\n\n## Compatibility modes\n\nThere is a certain number of compatibility mode shortcuts, namely:\n\n* `--compatibility '*'` (default) - Internet Explorer 10+ compatibility mode\n* `--compatibility ie9` - Internet Explorer 9+ compatibility mode\n* `--compatibility ie8` - Internet Explorer 8+ compatibility mode\n* `--compatibility ie7` - Internet Explorer 7+ compatibility mode\n\nEach of these modes is an alias to a [fine grained configuration](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/options/compatibility.js), with the following options available:\n\n```shell\ncleancss --compatibility '*,-properties.urlQuotes'\ncleancss --compatibility '*,+properties.ieBangHack,+properties.ieFilters'\n# [+-]colors.opacity controls `rgba()` / `hsla()` color support; defaults to `on` (+)\n# [+-]properties.backgroundClipMerging controls background-clip merging into shorthand; defaults to `on` (+)\n# [+-]properties.backgroundOriginMerging controls background-origin merging into shorthand; defaults to `on` (+)\n# [+-]properties.backgroundSizeMerging controls background-size merging into shorthand; defaults to `on` (+)\n# [+-]properties.colors controls color optimizations; defaults to `on` (+)\n# [+-]properties.ieBangHack controls keeping IE bang hack; defaults to `off` (-)\n# [+-]properties.ieFilters controls keeping IE `filter` / `-ms-filter`; defaults to `off` (-)\n# [+-]properties.iePrefixHack controls keeping IE prefix hack; defaults to `off` (-)\n# [+-]properties.ieSuffixHack controls keeping IE suffix hack; defaults to `off` (-)\n# [+-]properties.merging controls property merging based on understandability; defaults to `on` (+)\n# [+-]properties.shorterLengthUnits controls shortening pixel units into `pc`, `pt`, or `in` units; defaults to `off` (-)\n# [+-]properties.spaceAfterClosingBrace controls keeping space after closing brace - `url() no-repeat` cleancss --compatibility '*,into `url('roperties.no-repeat`; defaults to `on` (+)\n# [+-]properties.urlQuotes controls keeping quoting inside `url()`; defaults to `off` (-)\n# [+-]properties.zeroUnitsf units `0` value; defaults to `on` (+)\n# [+-]selectors.adjacentSpace controls extra space before `nav` element; defaults to `off` (-)\n# [+-]selectors.ie7Hack controls removal of IE7 selector hacks, e.g. `*+html...`; defaults to `on` (+)\n# [+-]units.ch controls treating `ch` as a supported unit; defaults to `on` (+)\n# [+-]units.in controls treating `in` as a supported unit; defaults to `on` (+)\n# [+-]units.pc controls treating `pc` as a supported unit; defaults to `on` (+)\n# [+-]units.pt controls treating `pt` as a supported unit; defaults to `on` (+)\n# [+-]units.rem controls treating `rem` as a supported unit; defaults to `on` (+)\n# [+-]units.vh controls treating `vh` as a supported unit; defaults to `on` (+)\n# [+-]units.vm controls treating `vm` as a supported unit; defaults to `on` (+)\n# [+-]units.vmax controls treating `vmax` as a supported unit; defaults to `on` (+)\n# [+-]units.vmin controls treating `vmin` as a supported unit; defaults to `on` (+)\n```\n\nYou can also chain more rules after a shortcut when setting a compatibility:\n\n```shell\ncleancss --compatibility 'ie9,-colors.opacity,-units.rem' one.css\n```\n\n## Formatting options\n\nThe `--format` option accept the following options:\n\n```shell\ncleancss --format beautify one.css\ncleancss --format keep-breaks one.css\ncleancss --format 'indentBy:1;indentWith:tab' one.css\ncleancss --format 'breaks:afterBlockBegins=on;spaces:aroundSelectorRelation=on' one.css\n# `breaks` controls where to insert breaks\n#   `afterAtRule` controls if a line break comes after an at-rule; e.g. `@charset`; defaults to `off` (alias to `false`)\n#   `afterBlockBegins` controls if a line break comes after a block begins; e.g. `@media`; defaults to `off`\n#   `afterBlockEnds` controls if a line break comes after a block ends, defaults to `off`\n#   `afterComment` controls if a line break comes after a comment; defaults to `off`\n#   `afterProperty` controls if a line break comes after a property; defaults to `off`\n#   `afterRuleBegins` controls if a line break comes after a rule begins; defaults to `off`\n#   `afterRuleEnds` controls if a line break comes after a rule ends; defaults to `off`\n#   `beforeBlockEnds` controls if a line break comes before a block ends; defaults to `off`\n#   `betweenSelectors` controls if a line break comes between selectors; defaults to `off`\n# `breakWith` controls the new line character, can be `windows` or `unix` (aliased via `crlf` and `lf`); defaults to system one, so former on Windows and latter on Unix\n# `indentBy` controls number of characters to indent with; defaults to `0`\n# `indentWith` controls a character to indent with, can be `space` or `tab`; defaults to `space`\n# `spaces` controls where to insert spaces\n#   `aroundSelectorRelation` controls if spaces come around selector relations; e.g. `div \u003e a`; defaults to `off`\n#   `beforeBlockBegins` controls if a space comes before a block begins; e.g. `.block {`; defaults to `off`\n#   `beforeValue` controls if a space comes before a value; e.g. `width: 1rem`; defaults to `off`\n# `wrapAt` controls maximum line length; defaults to `off`\n```\n\n## Inlining options\n\n`--inline` option whitelists which `@import` rules will be processed, e.g.\n\n```shell\ncleancss --inline local one.css # default\n```\n\n```shell\ncleancss --inline all # same as local,remote\n```\n\n```shell\ncleancss --inline local,mydomain.example.com one.css\n```\n\n```shell\ncleancss --inline 'local,remote,!fonts.googleapis.com' one.css\n```\n\n## Optimization levels\n\nThe `-O` option can be either `0`, `1` (default), or `2`, e.g.\n\n```shell\ncleancss -O2 one.css\n```\n\nor a fine-grained configuration given via a string.\n\nPlease note that level 1 optimization options are generally safe while level 2 optimizations should be safe for most users.\n\nImportant: The `-O` option is using the capital letter O (as in \"Oscar\"), not the number zero.\n\n### Level 0 optimizations\n\nLevel 0 optimizations simply means \"no optimizations\". Use it when you'd like to inline imports and / or rebase URLs but skip everything else, e.g.\n\n```shell\ncleancss -O0 one.css\n```\n\n### Level 1 optimizations\n\nLevel 1 optimizations (default) operate on single properties only, e.g. can remove units when not required, turn rgb colors to a shorter hex representation, remove comments, etc\n\nHere is a full list of available options:\n\n```shell\ncleancss -O1 one.css\ncleancss -O1 removeQuotes:off;roundingPrecision:4;specialComments:1 one.css\n# `cleanupCharsets` controls `@charset` moving to the front of a stylesheet; defaults to `on`\n# `normalizeUrls` controls URL normalzation; default to `on`\n# `optimizeBackground` controls `background` property optimizatons; defaults to `on`\n# `optimizeBorderRadius` controls `border-radius` property optimizatons; defaults to `on`\n# `optimizeFilter` controls `filter` property optimizatons; defaults to `on`\n# `optimizeFontWeight` controls `font-weight` property optimizatons; defaults to `on`\n# `optimizeOutline` controls `outline` property optimizatons; defaults to `on`\n# `removeEmpty` controls removing empty rules and nested blocks; defaults to `on` (since 4.1.0)\n# `removeNegativePaddings` controls removing negative paddings; defaults to `on`\n# `removeQuotes` controls removing quotes when unnecessary; defaults to `on`\n# `removeWhitespace` controls removing unused whitespace; defaults to `on`\n# `replaceMultipleZeros` contols removing redundant zeros; defaults to `on`\n# `replaceTimeUnits` controls replacing time units with shorter values; defaults to `on\n# `replaceZeroUnits` controls replacing zero values with units; defaults to `on`\n# `roundingPrecision` rounds pixel values to `N` decimal places; `off` disables rounding; defaults to `off`\n# `selectorsSortingMethod` denotes selector sorting method; can be `natural` or `standard`; defaults to `standard`\n# `specialComments` denotes a number of /*! ... */ comments preserved; defaults to `all`\n# `tidyAtRules` controls at-rules (e.g. `@charset`, `@import`) optimizing; defaults to `on`\n# `tidyBlockScopes` controls block scopes (e.g. `@media`) optimizing; defaults to `on`\n# `tidySelectors` controls selectors optimizing; defaults to `on`\n```\n\nThere is an `all` shortcut for toggling all options at the same time, e.g.\n\n```shell\ncleancss -O1 'all:off;tidySelectors:on' one.css\n```\n\n### Level 2 optimizations\n\nLevel 2 optimizations operate at rules or multiple properties level, e.g. can remove duplicate rules, remove properties redefined further down a stylesheet, or restructure rules by moving them around.\n\nPlease note that if level 2 optimizations are turned on then, unless explicitely disabled, level 1 optimizations are applied as well.\n\nHere is a full list of available options:\n\n```shell\ncleancss -O2 one.css\ncleancss -O2 mergeMedia:off;restructureRules:off;mergeSemantically:on;mergeIntoShorthands:off one.css\n# `mergeAdjacentRules` controls adjacent rules merging; defaults to `on`\n# `mergeIntoShorthands` controls merging properties into shorthands; defaults to `on`\n# `mergeMedia` controls `@media` merging; defaults to `on`\n# `mergeNonAdjacentRules` controls non-adjacent rule merging; defaults to `on`\n# `mergeSemantically` controls semantic merging; defaults to `off`\n# `overrideProperties` controls property overriding based on understandability; defaults to `on`\n# `reduceNonAdjacentRules` controls non-adjacent rule reducing; defaults to `on`\n# `removeDuplicateFontRules` controls duplicate `@font-face` removing; defaults to `on`\n# `removeDuplicateMediaBlocks` controls duplicate `@media` removing; defaults to `on`\n# `removeDuplicateRules` controls duplicate rules removing; defaults to `on`\n# `removeEmpty` controls removing empty rules and nested blocks; defaults to `on` (since 4.1.0)\n# `removeUnusedAtRules` controls unused at rule removing; defaults to `off` (since 4.1.0)\n# `restructureRules` controls rule restructuring; defaults to `off`\n# `skipProperties` controls which properties won\\'t be optimized, defaults to empty list which means all will be optimized (since 4.1.0)\n```\n\nThere is an `all` shortcut for toggling all options at the same time, e.g.\n\n```shell\ncleancss -O2 'all:off;removeDuplicateRules:on' one.css\n```\n\n# As a module\n\nclean-css-cli can also be used as a module in a way of enhancing its functionality in a programmatic way, e.g.\n\n```js\n#!/usr/bin/env node\n\nvar cleanCssCli = require('clean-css-cli');\n\nvar customPlugin = {\n  level1: {\n    value: function (propertyName, propertyValue, options) {\n      if (propertyName == 'background-image' \u0026\u0026 propertyValue.indexOf('../valid/path/to') == -1) {\n        return propertyValue.replace('url(', 'url(../valid/path/to/');\n      } else {\n        return propertyValue;\n      }\n    }\n  }\n}\n\nreturn cleanCssCli(process, function (cleanCss) {\n  cleanCss.options.plugins.level1Value.push(customPlugin.level1.value);\n});\n```\n\n# FAQ\n\nMore answers can be found in [clean-css FAQ section](https://github.com/jakubpawlowicz/clean-css#faq).\n\n## How to optimize multiple files?\n\nIt can be done by passing in paths to multiple files, e.g.\n\n```shell\ncleancss -o merged.min.css one.css two.css three.css\n```\n\nSince version 4.1.0 it can also be done using glob pattern matching, e.g.\n\n```shell\ncleancss -o merged.min.css *.css\n```\n\n## How to process multiple files without concatenating them into one output file?\n\nSince clean-css-cli 5.0 you can optimize files one by one, without joining them into one output file, e.g.\n\n```shell\ncleancss --batch styles/*.css\n```\n\nBy default it will pick up every single file from `styles` directory, optimize it, add a `-min` suffix to filename (before extension), and write it to disk.\n\nYou can use `--batch-suffix` option to customize the `-min` suffix, e.g.\n\n```shell\ncleancss --batch --batch-suffix '.min' styles/*.css # output will have `.min` suffix before `.css`, e.g. styles.min.css\n```\n\nor\n\n```shell\ncleancss --batch --batch-suffix '' styles/*.css # output files will OVERRIDE input files\n```\n\nRemember you can use [glob matching](https://www.npmjs.com/package/glob#glob-primer) to match exactly the files you want.\n\nSince clean-css-cli 5.1 you can also use a negated pattern to exclude some files from being matched, e.g.\n\n```shell\ncleancss --batch styles/*.css !styles/*.min.css\n```\n\n## How to specify a custom rounding precision?\n\nThe level 1 `roundingPrecision` optimization option accept a string with per-unit rounding precision settings, e.g.\n\n```shell\ncleancss -O1 roundingPrecision:all=3,px=5\n```\n\nwhich sets all units rounding precision to 3 digits except `px` unit precision of 5 digits.\n\n## How to rebase relative image URLs?\n\nclean-css-cli will rebase paths it automatically for you when full paths to input files are passed, and `--with-rebase` \u0026 `--output` options are used, e.g\n\n```css\n/*! one.css */\na {\n  background:url(image.png)\n}\n```\n\n```shell\ncleancss --with-rebase -o build/one.min.css one.css\n```\n\n```css\n/*! build/one.min.css */\na{background:url(../image.png)}\n```\n\n## How to apply level 1 \u0026 2 optimizations at the same time?\n\nUsing `-O` option twice and specifying optimization options in each, e.g.\n\n```shell\ncleancss -O1 all:on,normalizeUrls:off -O2 restructureRules:on one.css\n```\n\nwill apply level 1 optimizations, except url normalization, and default level 2 optimizations with rule restructuring.\n\n# Contributing\n\nSee [CONTRIBUTING.md](https://github.com/clean-css/clean-css-cli/blob/master/CONTRIBUTING.md).\n\n## How to get started?\n\nFirst clone the sources:\n\n```shell\ngit clone git@github.com:clean-css/clean-css-cli.git\n```\n\nthen install dependencies:\n\n```shell\ncd clean-css-cli\nnpm install\n```\n\nthen use any of the following commands to verify your copy:\n\n```shell\nnpm run check # to lint JS sources with [JSHint](https://github.com/jshint/jshint/)\nnpm test # to run all tests\n```\n\n# License\n\nclean-css-cli is released under the [MIT License](https://github.com/clean-css/clean-css-cli/blob/master/LICENSE).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclean-css%2Fclean-css-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclean-css%2Fclean-css-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclean-css%2Fclean-css-cli/lists"}