lib/config/buildPlugins.js
function resolveDependencyPaths(options) {
  function init(items) {
    // Invalid if not Array
    if (Array.isArray(items)) {
      items.forEach((item, idx, items) => {
        const isArray = Array.isArray(item);
        const id = isArray ? item[0] : item;

        // Ignore already resolved
        if ('string' == typeof id) {
          const filepath = dependencies.find(id);

          if (!filepath) return warn(`unable to load plugin ${strong(id)}`, 1);

          if (isArray) {
            item[0] = require(filepath);
          } else {
            items[idx] = require(filepath);
          }
        }
      });
    }
  }

  if (options.plugins) init(options.plugins);
  if (options.presets) init(options.presets);
}
function resolveDependencyPaths(options) {
  function init(items) {
    // Invalid if not Array
    if (Array.isArray(items)) {
      items.forEach((item, idx, items) => {
        const isArray = Array.isArray(item);
        const id = isArray ? item[0] : item;

        // Ignore already resolved
        if ('string' == typeof id) {
          const filepath = dependencies.find(id);

          if (!filepath) return warn(`unable to load plugin ${strong(id)}`, 1);

          if (isArray) {
            item[0] = require(filepath);
          } else {
            items[idx] = require(filepath);
          }
        }
      });
    }
  }

  if (options.plugins) init(options.plugins);
  if (options.presets) init(options.presets);
}
function resolveDependencyPaths ( options ) { function init ( items ) { // Invalid if not Array if ( Array . isArray ( items ) ) { items . forEach ( ( item , idx , items ) => { const isArray = Array . isArray ( item ) ; const id = isArray ? item [ 0 ] : item ; // Ignore already resolved if ( 'string' == typeof id ) { const filepath = dependencies . find ( id ) ; if ( ! filepath ) return warn ( ` ${ strong ( id ) } ` , 1 ) ; if ( isArray ) { item [ 0 ] = require ( filepath ) ; } else { items [ idx ] = require ( filepath ) ; } } } ) ; } } if ( options . plugins ) init ( options . plugins ) ; if ( options . presets ) init ( options . presets ) ; }
Resolve dependency paths in 'options' to modules
@param {Object} options
Resolve dependency paths in options to modules