This repository was archived by the owner on Mar 16, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -142,3 +142,9 @@ Custom options passed on pre-processor loader configuration
142142- ** Default:** ` {} `
143143
144144Custom options passed on [ css-loader] ( https://github.com/webpack-contrib/css-loader ) configuration
145+
146+ #### ` ruleOpts `
147+ - ** Type:** ` { [key:string]: any } `
148+ - ** Default:** ` {} `
149+
150+ Custom options passed on webpack rule configuration
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ const applyRule = (
9191 cssmodules : boolean | undefined ,
9292 dev : boolean
9393) => {
94- const { preprocessor, cssOpts, loaderOpts } = opts
94+ const { preprocessor, cssOpts, loaderOpts, ruleOpts } = opts
9595
9696 const loaderfn = loaders [ preprocessor as PreProcessor ]
9797 const loader = loaderfn ( loaderOpts )
@@ -105,6 +105,7 @@ const applyRule = (
105105 return {
106106 test : tests [ preprocessor as PreProcessor ] ,
107107 use : loader ( cssoptions , dev ) ,
108+ ...ruleOpts ,
108109 }
109110}
110111
@@ -113,13 +114,15 @@ export interface CSSPluginOptions {
113114 cssmodules ?: boolean
114115 loaderOpts ?: Opts
115116 cssOpts ?: Opts
117+ ruleOpts ?: Opts
116118}
117119
118120const defaultOpts : Record < string , any > = {
119121 preprocessor : 'postcss' ,
120122 cssmodules : false ,
121123 loadersOpts : { } ,
122124 cssOpts : { } ,
125+ ruleOpts : { } ,
123126}
124127
125128export const css = ( opts : CSSPluginOptions = defaultOpts ) =>
You can’t perform that action at this time.
0 commit comments