* @param {object} [options] https://github.com/postcss/postcss-loader#options * @param {string} [options.parser] Package name of custom PostCSS parser to use. * @param {string} [options.stringifier] Package name of custom PostCSS stringifier to use
(options = {})
| 15 | * @return {Function} |
| 16 | */ |
| 17 | function postcss(options = {}) { |
| 18 | if (Array.isArray(options)) { |
| 19 | throw Error( |
| 20 | 'Passing PostCSS plugins as a first argument is not supported anymore, use options.plugins instead' |
| 21 | ) |
| 22 | } |
| 23 | |
| 24 | return (context, util) => prevConfig => { |
| 25 | const ruleDef = Object.assign( |
| 26 | { |
| 27 | test: /\.css$/, |
| 28 | use: [ |
| 29 | { |
| 30 | loader: 'postcss-loader', |
| 31 | options |
| 32 | } |
| 33 | ] |
| 34 | }, |
| 35 | context.match |
| 36 | ) |
| 37 | |
| 38 | let nextConfig = util.addLoader(ruleDef)(prevConfig) |
| 39 | |
| 40 | return nextConfig |
| 41 | } |
| 42 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…