Skip to content

Commit 6f9c9f9

Browse files
Adds FAQ section on new --batch option.
1 parent 1daac06 commit 6f9c9f9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Previously a part of clean-css it's a separate package since clean-css 4.0.
3535
* [As a module](#as-a-module)
3636
- [FAQ](#faq)
3737
* [How to optimize multiple files?](#how-to-optimize-multiple-files)
38+
* [How to process multiple files without concatenating them into one output file?](#how-to-process-multiple-files-without-concatenating-them-into-one-output-file)
3839
* [How to specify a custom rounding precision?](#how-to-specify-a-custom-rounding-precision)
3940
* [How to rebase relative image URLs?](#how-to-rebase-relative-image-urls)
4041
* [How to apply level 1 & 2 optimizations at the same time?](#how-to-apply-level-1--2-optimizations-at-the-same-time)
@@ -364,6 +365,24 @@ Since version 4.1.0 it can also be done using glob pattern matching, e.g.
364365
cleancss -o merged.min.css *.css
365366
```
366367
368+
## How to process multiple files without concatenating them into one output file?
369+
370+
Since clean-css-cli 5.0 you can optimize files one by one, without joining them into one output file, e.g.
371+
372+
```shell
373+
cleancss --batch styles/*.css
374+
```
375+
376+
By 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.
377+
378+
You can use `--batch-suffix` option to customize the `-min` suffix, e.g.
379+
380+
```shell
381+
cleancss --batch --batch-suffix '.min' styles/*.css
382+
```
383+
384+
Remember you can use [glob matching](https://www.npmjs.com/package/glob#glob-primer) to match exactly the files you want.
385+
367386
## How to specify a custom rounding precision?
368387
369388
The level 1 `roundingPrecision` optimization option accept a string with per-unit rounding precision settings, e.g.

0 commit comments

Comments
 (0)