@@ -22,56 +22,58 @@ npm i -g|-D postcss-cli
2222
2323<h2 align =" center " >Usage</h2 >
2424
25- ``` bash
26- postcss [input.css] [OPTIONS] [-o| --output output.css] [-w| --watch]
2725```
26+ Usage:
27+ postcss [input.css] [OPTIONS] [-o|--output output.css] [--watch|-w]
28+ postcss <input.css>... [OPTIONS] --dir <output-directory> [--watch|-w]
29+ postcss <input.css>... [OPTIONS] --replace
30+
31+ Basic options:
32+ -o, --output Output file [string]
33+ -d, --dir Output directory [string]
34+ -r, --replace Replace (overwrite) the input file [boolean]
35+ --map, -m Create an external sourcemap
36+ --no-map Disable the default inline sourcemaps
37+ --watch, -w Watch files for changes and recompile as needed [boolean]
38+ --env A shortcut for setting NODE_ENV [string]
39+
40+ Options for when not using a config file:
41+ -u, --use List of postcss plugins to use [array]
42+ --parser Custom postcss parser [string]
43+ --stringifier Custom postcss stringifier [string]
44+ --syntax Custom postcss syntax [string]
45+
46+ Advanced options:
47+ --ext Override the output file extension; for use with --dir [string]
48+ --base Mirror the directory structure relative to this path in the output
49+ directory, for use with --dir [string]
50+ --poll Use polling for file watching. Can optionally pass polling interval;
51+ default 100 ms
52+ --config Set a custom path to look for a config file [string]
53+
54+ Options:
55+ -v, --version Show version number [boolean]
56+ -h, --help Show help [boolean]
57+
58+ Examples:
59+ postcss input.css -o output.css Basic usage
60+ cat input.css | postcss -u autoprefixer > output.css Piping input & output
61+
62+ If no input files are passed, it reads from stdin. If neither -o, --dir, or
63+ --replace is passed, it writes to stdout.
2864
29- The input may also be a glob:
30-
31- ``` bash
32- postcss " src/*.css" [OPTIONS]
65+ If there are multiple input files, the --dir or --replace option must be passed.
66+ Input files may contain globs.
3367```
3468
35- Recursively read a directory:
36-
37- ``` bash
38- postcss " src/**/*.css" [OPTIONS]
39- ```
69+ > ℹ️ More details on custom parsers, stringifiers and syntaxes, can be found [ here] ( https://github.com/postcss/postcss#syntaxes ) .
4070
41- > ⚠️ If there are multiple input files, the --dir or --replace option must be passed.
71+ To recursively read a directory, you'd do:
4272
4373``` bash
44- cat input .css | postcss [OPTIONS] > output.css
74+ postcss " src/**/* .css" [OPTIONS]
4575```
4676
47- > ⚠️ If no input files are passed, it reads from stdin. If neither -o, --dir, or
48- --replace is passed, it writes to stdout.
49-
50- <h2 align =" center " >Options</h2 >
51-
52- | Name| Type| Default| Description|
53- | :---| :--:| :-----:| :----------|
54- | ` -d, --dir ` | ` {String} ` | ` undefined ` | Output Directory|
55- | ` -b, --base ` | ` {String} ` | ` undefined ` | Use together with ` --dir ` for keeping directory structure.|
56- | ` -x, --ext ` | ` {String} ` | ` extname(output) ` | Output File Extension|
57- | ` -o, --output ` | ` {String} ` | ` undefined ` | Output File|
58- | ` -r, --replace ` | ` {String} ` | ` undefined ` | Replace Input <=> Output|
59- | ` -p, --parser ` | ` {String} ` | ` undefined ` | Custom PostCSS Parser|
60- | ` -s, --syntax ` | ` {String} ` | ` undefined ` | Custom PostCSS Syntax|
61- | ` -t, --stringifier ` | ` {String} ` | ` undefined ` | Custom PostCSS Stringifier|
62- | ` -w, --watch ` | ` {Boolean} ` | ` false ` | Enable Watch Mode|
63- | ` --poll ` | ` {Boolean\|Number} ` | ` 100 ` | Use polling for file watching. Can optionally pass polling interval; default 100 ms|
64- | ` -u, --use ` | ` {Array} ` | ` [] ` | PostCSS Plugins|
65- | ` -m, --map ` | ` {Boolean} ` | ` { inline: true } ` | External Sourcemaps|
66- | ` --no-map ` | ` {Boolean} ` | ` false ` | Disable Sourcemaps|
67- | ` -e, --env ` | ` {String} ` | ` process.env.NODE_ENV ` | Sets ` $NODE_ENV ` |
68- | ` -c, --config ` | ` {String} ` | ` dirname(file) ` | PostCSS Config Path ` postcss.config.js ` |
69- | ` -h, --help ` | ` {Boolean} ` | ` false ` | CLI Help|
70- | ` -v, --version ` | ` {Boolean} ` | ` false ` | CLI Version|
71-
72-
73- > ℹ️ More details on custom parsers, stringifiers and syntaxes, can be found [ here] ( https://github.com/postcss/postcss#syntaxes ) .
74-
7577### [ Config] ( https://github.com/michael-ciniawsky/postcss-load-config )
7678
7779If you need to pass options to your plugins, or have a long plugin chain, you'll want to use a configuration file.
0 commit comments