@@ -291,9 +291,6 @@ var AMDLoader;
291
291
if ( typeof options . isBuild !== 'boolean' ) {
292
292
options . isBuild = false ;
293
293
}
294
- if ( typeof options . buildForceInvokeFactory !== 'object' ) {
295
- options . buildForceInvokeFactory = { } ;
296
- }
297
294
if ( typeof options . paths !== 'object' ) {
298
295
options . paths = { } ;
299
296
}
@@ -326,9 +323,6 @@ var AMDLoader;
326
323
if ( typeof options . preferScriptTags === 'undefined' ) {
327
324
options . preferScriptTags = false ;
328
325
}
329
- if ( ! Array . isArray ( options . nodeModules ) ) {
330
- options . nodeModules = [ ] ;
331
- }
332
326
if ( options . nodeCachedData && typeof options . nodeCachedData === 'object' ) {
333
327
if ( typeof options . nodeCachedData . seed !== 'string' ) {
334
328
options . nodeCachedData . seed = 'seed' ;
@@ -374,19 +368,13 @@ var AMDLoader;
374
368
this . _env = env ;
375
369
this . options = ConfigurationOptionsUtil . mergeConfigurationOptions ( options ) ;
376
370
this . _createIgnoreDuplicateModulesMap ( ) ;
377
- this . _createNodeModulesMap ( ) ;
378
371
this . _createSortedPathsRules ( ) ;
379
372
if ( this . options . baseUrl === '' ) {
380
373
if ( this . options . nodeRequire && this . options . nodeRequire . main && this . options . nodeRequire . main . filename && this . _env . isNode ) {
381
374
var nodeMain = this . options . nodeRequire . main . filename ;
382
375
var dirnameIndex = Math . max ( nodeMain . lastIndexOf ( '/' ) , nodeMain . lastIndexOf ( '\\' ) ) ;
383
376
this . options . baseUrl = nodeMain . substring ( 0 , dirnameIndex + 1 ) ;
384
377
}
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
- }
390
378
}
391
379
}
392
380
Configuration . prototype . _createIgnoreDuplicateModulesMap = function ( ) {
@@ -396,14 +384,6 @@ var AMDLoader;
396
384
this . ignoreDuplicateModulesMap [ this . options . ignoreDuplicateModules [ i ] ] = true ;
397
385
}
398
386
} ;
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
- } ;
407
387
Configuration . prototype . _createSortedPathsRules = function ( ) {
408
388
var _this = this ;
409
389
// Create an array our of the paths rules, sorted descending by length to
@@ -482,8 +462,8 @@ var AMDLoader;
482
462
*/
483
463
Configuration . prototype . moduleIdToPaths = function ( moduleId ) {
484
464
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 ) ) ;
487
467
if ( isNodeModule ) {
488
468
// This is a node module...
489
469
if ( this . isBuild ( ) ) {
@@ -545,8 +525,13 @@ var AMDLoader;
545
525
return true ;
546
526
}
547
527
// 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 ;
550
535
} ;
551
536
/**
552
537
* Test if module `moduleId` is expected to be defined multiple times
0 commit comments