@@ -291,9 +291,6 @@ var AMDLoader;
291291 if ( typeof options . isBuild !== 'boolean' ) {
292292 options . isBuild = false ;
293293 }
294- if ( typeof options . buildForceInvokeFactory !== 'object' ) {
295- options . buildForceInvokeFactory = { } ;
296- }
297294 if ( typeof options . paths !== 'object' ) {
298295 options . paths = { } ;
299296 }
@@ -326,9 +323,6 @@ var AMDLoader;
326323 if ( typeof options . preferScriptTags === 'undefined' ) {
327324 options . preferScriptTags = false ;
328325 }
329- if ( ! Array . isArray ( options . nodeModules ) ) {
330- options . nodeModules = [ ] ;
331- }
332326 if ( options . nodeCachedData && typeof options . nodeCachedData === 'object' ) {
333327 if ( typeof options . nodeCachedData . seed !== 'string' ) {
334328 options . nodeCachedData . seed = 'seed' ;
@@ -374,19 +368,13 @@ var AMDLoader;
374368 this . _env = env ;
375369 this . options = ConfigurationOptionsUtil . mergeConfigurationOptions ( options ) ;
376370 this . _createIgnoreDuplicateModulesMap ( ) ;
377- this . _createNodeModulesMap ( ) ;
378371 this . _createSortedPathsRules ( ) ;
379372 if ( this . options . baseUrl === '' ) {
380373 if ( this . options . nodeRequire && this . options . nodeRequire . main && this . options . nodeRequire . main . filename && this . _env . isNode ) {
381374 var nodeMain = this . options . nodeRequire . main . filename ;
382375 var dirnameIndex = Math . max ( nodeMain . lastIndexOf ( '/' ) , nodeMain . lastIndexOf ( '\\' ) ) ;
383376 this . options . baseUrl = nodeMain . substring ( 0 , dirnameIndex + 1 ) ;
384377 }
385- if ( this . options . nodeMain && this . _env . isNode ) {
386- var nodeMain = this . options . nodeMain ;
387- var dirnameIndex = Math . max ( nodeMain . lastIndexOf ( '/' ) , nodeMain . lastIndexOf ( '\\' ) ) ;
388- this . options . baseUrl = nodeMain . substring ( 0 , dirnameIndex + 1 ) ;
389- }
390378 }
391379 }
392380 Configuration . prototype . _createIgnoreDuplicateModulesMap = function ( ) {
@@ -396,14 +384,6 @@ var AMDLoader;
396384 this . ignoreDuplicateModulesMap [ this . options . ignoreDuplicateModules [ i ] ] = true ;
397385 }
398386 } ;
399- Configuration . prototype . _createNodeModulesMap = function ( ) {
400- // Build a map out of nodeModules array
401- this . nodeModulesMap = Object . create ( null ) ;
402- for ( var _i = 0 , _a = this . options . nodeModules ; _i < _a . length ; _i ++ ) {
403- var nodeModule = _a [ _i ] ;
404- this . nodeModulesMap [ nodeModule ] = true ;
405- }
406- } ;
407387 Configuration . prototype . _createSortedPathsRules = function ( ) {
408388 var _this = this ;
409389 // Create an array our of the paths rules, sorted descending by length to
@@ -482,8 +462,8 @@ var AMDLoader;
482462 */
483463 Configuration . prototype . moduleIdToPaths = function ( moduleId ) {
484464 if ( this . _env . isNode ) {
485- var isNodeModule = ( ( this . nodeModulesMap [ moduleId ] === true )
486- || ( this . options . amdModulesPattern instanceof RegExp && ! this . options . amdModulesPattern . test ( moduleId ) ) ) ;
465+ var isNodeModule = ( this . options . amdModulesPattern instanceof RegExp
466+ && ! this . options . amdModulesPattern . test ( moduleId ) ) ;
487467 if ( isNodeModule ) {
488468 // This is a node module...
489469 if ( this . isBuild ( ) ) {
@@ -545,8 +525,13 @@ var AMDLoader;
545525 return true ;
546526 }
547527 // during a build, only explicitly marked or anonymous modules get their factories invoked
548- return ( this . options . buildForceInvokeFactory [ strModuleId ]
549- || AMDLoader . Utilities . isAnonymousModule ( strModuleId ) ) ;
528+ if ( AMDLoader . Utilities . isAnonymousModule ( strModuleId ) ) {
529+ return true ;
530+ }
531+ if ( this . options . buildForceInvokeFactory && this . options . buildForceInvokeFactory [ strModuleId ] ) {
532+ return true ;
533+ }
534+ return false ;
550535 } ;
551536 /**
552537 * Test if module `moduleId` is expected to be defined multiple times
0 commit comments