lib/config/index.js
function parsePlugins(config) {
  let plugins = [];

  function parse(plugins) {
    return plugins.map(plugin => {
      if ('string' == typeof plugin) plugin = path.resolve(plugin);
      return plugin;
    });
  }

  // Handle plugin paths defined in config file
  if (config.plugins) {
    plugins.push(...parse(config.plugins));
    delete config.plugins;
  }
  // Handle plugin paths/functions defined in runtime options
  if (config.runtimeOptions.plugins) {
    plugins.push(...parse(config.runtimeOptions.plugins));
    delete config.runtimeOptions.plugins;
  }

  return plugins;
}
function parsePlugins(config) {
  let plugins = [];

  function parse(plugins) {
    return plugins.map(plugin => {
      if ('string' == typeof plugin) plugin = path.resolve(plugin);
      return plugin;
    });
  }

  // Handle plugin paths defined in config file
  if (config.plugins) {
    plugins.push(...parse(config.plugins));
    delete config.plugins;
  }
  // Handle plugin paths/functions defined in runtime options
  if (config.runtimeOptions.plugins) {
    plugins.push(...parse(config.runtimeOptions.plugins));
    delete config.runtimeOptions.plugins;
  }

  return plugins;
}
function parsePlugins ( config ) { let plugins = [ ] ; function parse ( plugins ) { return plugins . map ( plugin => { if ( 'string' == typeof plugin ) plugin = path . resolve ( plugin ) ; return plugin ; } ) ; } // Handle plugin paths defined in config file if ( config . plugins ) { plugins . push ( ... parse ( config . plugins ) ) ; delete config . plugins ; } // Handle plugin paths/functions defined in runtime options if ( config . runtimeOptions . plugins ) { plugins . push ( ... parse ( config . runtimeOptions . plugins ) ) ; delete config . runtimeOptions . plugins ; } return plugins ; }
Parse plugins defined in 'config'
@param {Config} config
@returns {Array}
Parse plugins defined in config