@@ -62,18 +62,18 @@ describe("ConfigTestCases", function() {
6262 console : console
6363 } ;
6464
65- function _require ( module ) {
65+ function _require ( currentDirectory , module ) {
6666 if ( Array . isArray ( module ) || / ^ \. \. ? \/ / . test ( module ) ) {
6767 var fn ;
6868 var content ;
6969 if ( Array . isArray ( module ) ) {
70- var p = path . join ( outputDirectory , module [ 0 ] ) ;
70+ var p = path . join ( currentDirectory , module [ 0 ] ) ;
7171 content = module . map ( function ( p ) {
72- var p = path . join ( outputDirectory , p ) ;
72+ var p = path . join ( currentDirectory , p ) ;
7373 return fs . readFileSync ( p , "utf-8" ) ;
7474 } ) . join ( "\n" ) ;
7575 } else {
76- var p = path . join ( outputDirectory , module ) ;
76+ var p = path . join ( currentDirectory , module ) ;
7777 content = fs . readFileSync ( p , "utf-8" ) ;
7878 }
7979 if ( options . target === "web" ) {
@@ -84,7 +84,7 @@ describe("ConfigTestCases", function() {
8484 var module = {
8585 exports : { }
8686 } ;
87- fn . call ( module . exports , _require , module , module . exports , outputDirectory , p , _it , globalContext ) ;
87+ fn . call ( module . exports , _require . bind ( null , path . dirname ( p ) ) , module , module . exports , path . dirname ( p ) , p , _it , globalContext ) ;
8888 return module . exports ;
8989 } else if ( testConfig . modules && module in testConfig . modules ) {
9090 return testConfig . modules [ module ] ;
@@ -108,7 +108,7 @@ describe("ConfigTestCases", function() {
108108 var bundlePath = testConfig . findBundle ( i , optionsArr [ i ] ) ;
109109 if ( bundlePath ) {
110110 filesCount ++ ;
111- _require ( bundlePath ) ;
111+ _require ( outputDirectory , bundlePath ) ;
112112 }
113113 }
114114 // give a free pass to compilation that generated an error
0 commit comments