@@ -125,13 +125,14 @@ Thankfully there are a two solutions to this problem:
125125
126126## Options
127127
128- | Name | Type | Default | Description |
129- | :---------------------------------------: | :------------------: | :-------------------------------------: | :---------------------------------------------------------------- |
130- | ** [ ` implementation ` ] ( #implementation ) ** | ` {Object\|String} ` | ` sass ` | Setup Sass implementation to use. |
131- | ** [ ` sassOptions ` ] ( #sassoptions ) ** | ` {Object\|Function} ` | defaults values for Sass implementation | Options for Sass. |
132- | ** [ ` sourceMap ` ] ( #sourcemap ) ** | ` {Boolean} ` | ` compiler.devtool ` | Enables/Disables generation of source maps. |
133- | ** [ ` additionalData ` ] ( #additionaldata ) ** | ` {String\|Function} ` | ` undefined ` | Prepends/Appends ` Sass ` /` SCSS ` code before the actual entry file. |
134- | ** [ ` webpackImporter ` ] ( #webpackimporter ) ** | ` {Boolean} ` | ` true ` | Enables/Disables the default Webpack importer. |
128+ | Name | Type | Default | Description |
129+ | :-------------------------------------------: | :------------------: | :-------------------------------------: | :---------------------------------------------------------------- |
130+ | ** [ ` implementation ` ] ( #implementation ) ** | ` {Object\|String} ` | ` sass ` | Setup Sass implementation to use. |
131+ | ** [ ` sassOptions ` ] ( #sassoptions ) ** | ` {Object\|Function} ` | defaults values for Sass implementation | Options for Sass. |
132+ | ** [ ` sourceMap ` ] ( #sourcemap ) ** | ` {Boolean} ` | ` compiler.devtool ` | Enables/Disables generation of source maps. |
133+ | ** [ ` additionalData ` ] ( #additionaldata ) ** | ` {String\|Function} ` | ` undefined ` | Prepends/Appends ` Sass ` /` SCSS ` code before the actual entry file. |
134+ | ** [ ` webpackImporter ` ] ( #webpackimporter ) ** | ` {Boolean} ` | ` true ` | Enables/Disables the default Webpack importer. |
135+ | ** [ ` warnRuleAsWarning ` ] ( #warnruleaswarning ) ** | ` {Boolean} ` | ` false ` | Treats the ` @warn ` rule as a webpack warning. |
135136
136137### ` implementation `
137138
@@ -610,6 +611,65 @@ module.exports = {
610611};
611612```
612613
614+ ### ` warnRuleAsWarning `
615+
616+ Type: ` Boolean `
617+ Default: ` false `
618+
619+ Treats the ` @warn ` rule as a webpack warning.
620+
621+ > ℹ️ It will be ` true ` by default in the next major release.
622+
623+ ** style.scss**
624+
625+ ``` scss
626+ $known-prefixes : webkit, moz, ms, o;
627+
628+ @mixin prefix ($property , $value , $prefixes ) {
629+ @each $prefix in $prefixes {
630+ @if not index ($known-prefixes , $prefix ) {
631+ @warn " Unknown prefix #{$prefix } ." ;
632+ }
633+
634+ - #{$prefix } - #{$property } : $value ;
635+ }
636+ #{$property } : $value ;
637+ }
638+
639+ .tilt {
640+ // Oops, we typo'd "webkit" as "wekbit"!
641+ @include prefix (transform , rotate (15deg ), wekbit ms);
642+ }
643+ ```
644+
645+ The presented code will throw webpack warning instead logging.
646+
647+ To ignore unnecessary warnings you can use the [ ignoreWarnings] ( /configuration/other-options/#ignorewarnings ) option.
648+
649+ ** webpack.config.js**
650+
651+ ``` js
652+ module .exports = {
653+ module: {
654+ rules: [
655+ {
656+ test: / \. s[ac] ss$ / i ,
657+ use: [
658+ " style-loader" ,
659+ " css-loader" ,
660+ {
661+ loader: " sass-loader" ,
662+ options: {
663+ warnRuleAsWarning: true ,
664+ },
665+ },
666+ ],
667+ },
668+ ],
669+ },
670+ };
671+ ```
672+
613673## Examples
614674
615675### Extracts CSS into separate files
0 commit comments