lib/packExternalModules.js
function removeExcludedModules(modules, packageForceExcludes, log) {
  const excludedModules = _.remove(modules, externalModule => {   // eslint-disable-line lodash/prefer-immutable-method
    const splitModule = _.split(externalModule, '@');
    // If we have a scoped module we have to re-add the @
    if (_.startsWith(externalModule, '@')) {
      splitModule.splice(0, 1);
      splitModule[0] = '@' + splitModule[0];
    }
    const moduleName = _.first(splitModule);
    return _.includes(packageForceExcludes, moduleName);
  });

  if (log && !_.isEmpty(excludedModules)) {
    this.serverless.cli.log(`Excluding external modules: ${_.join(excludedModules, ', ')}`);
  }
}
function removeExcludedModules(modules, packageForceExcludes, log) {
  const excludedModules = _.remove(modules, externalModule => {   // eslint-disable-line lodash/prefer-immutable-method
    const splitModule = _.split(externalModule, '@');
    // If we have a scoped module we have to re-add the @
    if (_.startsWith(externalModule, '@')) {
      splitModule.splice(0, 1);
      splitModule[0] = '@' + splitModule[0];
    }
    const moduleName = _.first(splitModule);
    return _.includes(packageForceExcludes, moduleName);
  });

  if (log && !_.isEmpty(excludedModules)) {
    this.serverless.cli.log(`Excluding external modules: ${_.join(excludedModules, ', ')}`);
  }
}
function removeExcludedModules ( modules , packageForceExcludes , log ) { const excludedModules = _ . remove ( modules , externalModule => { // eslint-disable-line lodash/prefer-immutable-method const splitModule = _ . split ( externalModule , '@' ) ; // If we have a scoped module we have to re-add the @ if ( _ . startsWith ( externalModule , '@' ) ) { splitModule . splice ( 0 , 1 ) ; splitModule [ 0 ] = '@' + splitModule [ 0 ] ; } const moduleName = _ . first ( splitModule ) ; return _ . includes ( packageForceExcludes , moduleName ) ; } ) ; if ( log && ! _ . isEmpty ( excludedModules ) ) { this . serverless . cli . log ( ` ${ _ . join ( excludedModules , ', ' ) } ` ) ; } }
Remove a given list of excluded modules from a module list
@this - The active plugin instance
Remove a given list of excluded modules from a module list