(css)
| 126 | return { |
| 127 | postcssPlugin: "postcss-pxtorem", |
| 128 | Once(css) { |
| 129 | const filePath = css.source.input.file; |
| 130 | if ( |
| 131 | exclude && |
| 132 | ((type.isFunction(exclude) && exclude(filePath)) || |
| 133 | (type.isString(exclude) && filePath.indexOf(exclude) !== -1) || |
| 134 | filePath.match(exclude) !== null) |
| 135 | ) { |
| 136 | isExcludeFile = true; |
| 137 | } else { |
| 138 | isExcludeFile = false; |
| 139 | } |
| 140 | |
| 141 | const rootValue = |
| 142 | typeof opts.rootValue === "function" |
| 143 | ? opts.rootValue(css.source.input) |
| 144 | : opts.rootValue; |
| 145 | pxReplace = createPxReplace( |
| 146 | rootValue, |
| 147 | opts.unitPrecision, |
| 148 | opts.minPixelValue |
| 149 | ); |
| 150 | }, |
| 151 | Declaration(decl) { |
| 152 | if (isExcludeFile) return; |
| 153 |
nothing calls this directly
no test coverage detected
searching dependent graphs…