Skip to content

Commit 634681e

Browse files
author
Edwin Zhang
committed
README: add emitWarningsAsErrors to the readme
1 parent 5c960dd commit 634681e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ module.exports = {
117117
|[`config`](#config)|`{Object}`|`undefined`|Set `postcss.config.js` config path && `ctx`|
118118
|[`plugins`](#plugins)|`{Array\|Function}`|`[]`|Set PostCSS Plugins|
119119
|[`sourceMap`](#sourcemap)|`{String\|Boolean}`|`false`|Enable Source Maps|
120+
|[`emitWarningsAsErrors`](#emitwarningsaserrors)|`{Boolean}`|`false`|Emit warnings as errors|
120121

121122
### `Exec`
122123

@@ -305,6 +306,22 @@ within the CSS directly as an annotation comment.
305306
/*# sourceMappingURL=data:application/json;base64, ... */
306307
```
307308

309+
### `EmitWarningsAsErrors`
310+
311+
Enabling `emitWarningsAsErrors` will emit any warnings from postcss plugins at the error level.
312+
313+
**`webpack.config.js`**
314+
```js
315+
{
316+
test: /\.css$/,
317+
use: [
318+
...,
319+
{ loader: 'postcss-loader', options: { emitWarningsAsErrors: true } }
320+
]
321+
}
322+
```
323+
324+
308325
<h2 align="center">Examples</h2>
309326

310327
### `Stylelint`

0 commit comments

Comments
 (0)