index.js
function getPlugins (options) {
  var plugins = options.use || options.u;
  if (!plugins) {
    plugins = getDefaultPlugins(options);
  }
  else {
    if (typeof plugins === 'string') {
      plugins = [plugins];
    }
  }

  var postcssBefore = options.postcssBefore || options.before || [];
  var postcssAfter = options.postcssAfter || options.after || [];
  plugins = (Array.isArray(postcssBefore) ? postcssBefore : [postcssBefore]).concat(plugins).concat(postcssAfter);

  // load plugins by name (if a string is used)
  return plugins.map(function requirePlugin (name) {
    // assume not strings are already required plugins
    if (typeof name !== 'string') {
      return name;
    }

    var plugin = module.parent.require(name);

    // custom scoped name generation
    if (name === 'postcss-modules-scope') {
      options[name] = options[name] || {};
      if (!options[name].generateScopedName) {
        options[name].generateScopedName = generateLongName;
      }
    }

    if (name in options) {
      plugin = plugin(options[name]);
    }
    else {
      plugin = plugin.postcss || plugin();
    }

    return plugin;
  });
}
function getPlugins (options) {
  var plugins = options.use || options.u;
  if (!plugins) {
    plugins = getDefaultPlugins(options);
  }
  else {
    if (typeof plugins === 'string') {
      plugins = [plugins];
    }
  }

  var postcssBefore = options.postcssBefore || options.before || [];
  var postcssAfter = options.postcssAfter || options.after || [];
  plugins = (Array.isArray(postcssBefore) ? postcssBefore : [postcssBefore]).concat(plugins).concat(postcssAfter);

  // load plugins by name (if a string is used)
  return plugins.map(function requirePlugin (name) {
    // assume not strings are already required plugins
    if (typeof name !== 'string') {
      return name;
    }

    var plugin = module.parent.require(name);

    // custom scoped name generation
    if (name === 'postcss-modules-scope') {
      options[name] = options[name] || {};
      if (!options[name].generateScopedName) {
        options[name].generateScopedName = generateLongName;
      }
    }

    if (name in options) {
      plugin = plugin(options[name]);
    }
    else {
      plugin = plugin.postcss || plugin();
    }

    return plugin;
  });
}
function getPlugins ( options ) { var plugins = options . use || options . u ; if ( ! plugins ) { plugins = getDefaultPlugins ( options ) ; } else { if ( typeof plugins === 'string' ) { plugins = [ plugins ] ; } } var postcssBefore = options . postcssBefore || options . before || [ ] ; var postcssAfter = options . postcssAfter || options . after || [ ] ; plugins = ( Array . isArray ( postcssBefore ) ? postcssBefore : [ postcssBefore ] ) . concat ( plugins ) . concat ( postcssAfter ) ; // load plugins by name (if a string is used) return plugins . map ( function requirePlugin ( name ) { // assume not strings are already required plugins if ( typeof name !== 'string' ) { return name ; } var plugin = module . parent . require ( name ) ; // custom scoped name generation if ( name === 'postcss-modules-scope' ) { options [ name ] = options [ name ] || { } ; if ( ! options [ name ] . generateScopedName ) { options [ name ] . generateScopedName = generateLongName ; } } if ( name in options ) { plugin = plugin ( options [ name ] ) ; } else { plugin = plugin . postcss || plugin ( ) ; } return plugin ; } ) ; }
PostCSS plugins passed to FileSystemLoader
PostCSS plugins passed to FileSystemLoader