src/lib/index.js
function requireLoader(loaderConfig) {
  const errMsgBase = `while requiring loader ${JSON.stringify(loaderConfig)} config,`;
  if (typeof loaderConfig !== 'object') { throw error(`${errMsgBase}, config must be object, got ${typeof loaderConfig}`); }
  if (typeof loaderConfig.loader !== 'string') { throw error(`${errMsgBase}, config.loader must be String, got ${JSON.stringify(loaderConfig.loader)}`); }

  return require(loaderConfig.loader); // eslint-disable-line
}
function requireLoader(loaderConfig) {
  const errMsgBase = `while requiring loader ${JSON.stringify(loaderConfig)} config,`;
  if (typeof loaderConfig !== 'object') { throw error(`${errMsgBase}, config must be object, got ${typeof loaderConfig}`); }
  if (typeof loaderConfig.loader !== 'string') { throw error(`${errMsgBase}, config.loader must be String, got ${JSON.stringify(loaderConfig.loader)}`); }

  return require(loaderConfig.loader); // eslint-disable-line
}
function requireLoader ( loaderConfig ) { const errMsgBase = ` ${ JSON . stringify ( loaderConfig ) } ` ; if ( typeof loaderConfig !== 'object' ) { throw error ( ` ${ errMsgBase } ${ typeof loaderConfig } ` ) ; } if ( typeof loaderConfig . loader !== 'string' ) { throw error ( ` ${ errMsgBase } ${ JSON . stringify ( loaderConfig . loader ) } ` ) ; } return require ( loaderConfig . loader ) ; // eslint-disable-line }
Require the loader

@method requireLoader
@param {Object} loaderConfig the loader config
@return {Object} loader the required loader
Require the loader