Skip to content

Commit 0c77213

Browse files
doc: show available options for plugin
1 parent b8b445e commit 0c77213

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,32 @@ import './layout.css'
6262

6363
### Options
6464

65-
There is 1 option: `output`.
6665
By default the plugin will use `output.assetFileNames` to decide the filename.
6766

6867
```js
6968
css({
70-
// Optional: filename to write all styles to
71-
output: 'bundle.css'
69+
exclude, // [optional] - Array of glob/Strings like what `include` uses.
70+
fileName, // [optional] - File name of emitted asset.
71+
include, // [optional] - Array of glob/Strings - default: ['**/*.css'].
72+
name, // [optional] - Name of the emitted asset.
73+
output, // [optional] - Below are the possible values for `output`:
74+
75+
// ---------------------------------------------------------------------------
76+
// Filename to write all styles to
77+
output: 'bundle.css',
78+
79+
// Callback that will be called on generate with two arguments:
80+
// - styles: the contents of all style tags combined: 'body { color: green }'
81+
// - styleNodes: an array of style objects: [{ lang: 'css', content: 'body { color: green }' }]
82+
output: (styles, styleNodes) => {
83+
writeFileSync('bundle.css', styles)
84+
},
85+
86+
// Disable any style output or callbacks
87+
output: false,
88+
89+
// Default behaviour is to write all styles to the bundle destination where .js is replaced by .css
90+
output: null
7291
})
7392
```
7493

0 commit comments

Comments
 (0)