How to use the postcss-loader/src/options.call function in postcss-loader

To help you get started, we’ve selected a few postcss-loader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github silvenon / css-customs / packages / css-customs-loader / lib / index.js View on Github external
return callback(err)
  }

  const postcssLoader = this.loaders[postcssLoaderIndex]
  let postcssPlugins
  let postcssOptions

  // imitating postcss-loader behavior
  // https://github.com/postcss/postcss-loader/blob/master/src/index.js

  if (
    Object.keys(postcssLoader.options || {}).filter(
      option => !['ident', 'config', 'sourceMap'].includes(option)
    ).length > 0
  ) {
    const { options, plugins } = await parsePostcssLoaderOptions.call(
      this,
      postcssLoader.options
    )
    postcssOptions = options
    postcssPlugins = plugins
  } else {
    const file = this.resourcePath
    const rc = {
      path: path.dirname(file),
      ctx: {
        cwd: this.context,
        file: {
          extname: path.extname(file),
          dirname: path.dirname(file),
          basename: path.basename(file),
        },

postcss-loader

PostCSS loader for webpack

MIT
Latest version published 8 months ago

Package Health Score

88 / 100
Full package analysis