MCPcopy Index your code
hub / github.com/andywer/webpack-blocks / postcss

Function postcss

packages/postcss/index.js:17–42  ·  view source on GitHub ↗

* @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 = {})

Source from the content-addressed store, hash-verified

15 * @return {Function}
16 */
17function 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}

Callers 5

productionConfigFunction · 0.85
webpack.config.jsFile · 0.85
webpack.config.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…