@@ -843,16 +843,20 @@ test('Bundler traces files with paths mapping', t => {
843843 'node_modules/dumber-module-loader/dist/index.js' : 'dumber-module-loader' ,
844844 'node_modules/foo/package.json' : JSON . stringify ( { name : 'foo' , main : 'index' } ) ,
845845 'node_modules/foo/index.js' : 'loo' ,
846+ 'node_modules/bar/package.json' : JSON . stringify ( { name : 'bar' , main : 'index' } ) ,
847+ 'node_modules/bar/index.js' : '' ,
848+ 'node_modules/bar/el.js' : '' ,
846849 } ;
847850 const bundler = createBundler ( fakeFs , {
848851 paths : {
849852 'foo' : 'common/foo' ,
853+ 'el' : 'bar/el' ,
850854 '../src' : ''
851855 }
852856 } ) ;
853857
854858 Promise . resolve ( )
855- . then ( ( ) => bundler . capture ( { path : 'src/app.js' , contents : 'foo' , moduleId : 'app' } ) )
859+ . then ( ( ) => bundler . capture ( { path : 'src/app.js' , contents : 'el! foo' , moduleId : 'app' } ) )
856860 . then ( ( ) => bundler . capture ( { path : 'src/common/foo.js' , contents : '' , moduleId : 'common/foo' } ) )
857861 . then ( ( ) => bundler . capture ( { path : 'test/app.spec.js' , contents : '../src/app' , moduleId : '../test/app.spec' } ) )
858862 . then ( ( ) => bundler . resolve ( ) )
@@ -865,14 +869,18 @@ test('Bundler traces files with paths mapping', t => {
865869 { contents : 'dumber-module-loader;' } ,
866870 { contents : 'define.switchToUserSpace();' } ,
867871 { path : 'test/app.spec.js' , contents : "define('../test/app.spec',[\"../src/app\"],1);" , sourceMap : undefined } ,
868- { path : 'src/app.js' , contents : "define('app',[\"foo\"],1);" , sourceMap : undefined } ,
869- { path : 'src/common/foo.js' , contents : "define('common/foo',[],1);" , sourceMap : undefined }
872+ { path : 'src/app.js' , contents : "define('app',[\"el!foo\"],1);" , sourceMap : undefined } ,
873+ { path : 'src/common/foo.js' , contents : "define('common/foo',[],1);" , sourceMap : undefined } ,
874+ { contents : 'define.switchToPackageSpace();' } ,
875+ { path : 'node_modules/bar/el.js' , contents : "define('bar/el',[],1);" , sourceMap : undefined } ,
876+ { contents : 'define.switchToUserSpace();' } ,
870877 ] ,
871878 config : {
872879 baseUrl : '/dist' ,
873880 bundles : { } ,
874881 paths : {
875882 'foo' : 'common/foo' ,
883+ 'el' : 'bar/el' ,
876884 '../src' : ''
877885 }
878886 }
0 commit comments