@@ -92,17 +92,17 @@ test('Bundler traces files', t => {
9292 'entry-bundle' : {
9393 files : [
9494 { contents : 'var pre = 1;' } ,
95- { contents : 'setup' } ,
96- { contents : 'dumber-module-loader' } ,
95+ { contents : 'setup; ' } ,
96+ { contents : 'dumber-module-loader; ' } ,
9797 { contents : 'define.switchToUserSpace();' } ,
9898 { path : 'src/app.js' , contents : "define('app',[\"foo\",\"page/one\"],1);" , sourceMap : undefined } ,
9999 { path : 'src/page/one.js' , contents : "define('page/one',[\"foo/bar\",\"loo\"],1);" , sourceMap : undefined } ,
100100 { contents : 'define.switchToPackageSpace();' } ,
101101 { path : 'node_modules/foo/bar.js' , contents : "define('foo/bar',[],1);" , sourceMap : undefined } ,
102- { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[\"loo\"],1);define('foo',['foo/index'],function(m){return m;});\n " , sourceMap : undefined } ,
103- { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});\n " , sourceMap : undefined } ,
102+ { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[\"loo\"],1);define('foo',['foo/index'],function(m){return m;});" , sourceMap : undefined } ,
103+ { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});" , sourceMap : undefined } ,
104104 { contents : 'define.switchToUserSpace();' } ,
105- { contents : 'after' } ,
105+ { contents : 'after; ' } ,
106106 { contents : 'var ape = 1;' } ,
107107 ] ,
108108 config : {
@@ -147,12 +147,12 @@ test('Bundler traces files, split bundles', t => {
147147 'entry-bundle' : {
148148 files : [
149149 { contents : 'var pre = 1;' } ,
150- { contents : 'setup' } ,
151- { contents : 'dumber-module-loader' } ,
150+ { contents : 'setup; ' } ,
151+ { contents : 'dumber-module-loader; ' } ,
152152 { contents : 'define.switchToUserSpace();' } ,
153153 { path : 'src/app.js' , contents : "define('app',[\"foo\",\"page/one\"],1);" , sourceMap : undefined } ,
154154 { path : 'src/page/one.js' , contents : "define('page/one',[\"foo/bar\",\"loo\"],1);" , sourceMap : undefined } ,
155- { contents : 'after' } ,
155+ { contents : 'after; ' } ,
156156 { contents : 'var ape = 1;' } ,
157157 ] ,
158158 config : {
@@ -169,8 +169,8 @@ test('Bundler traces files, split bundles', t => {
169169 files : [
170170 { contents : 'define.switchToPackageSpace();' } ,
171171 { path : 'node_modules/foo/bar.js' , contents : "define('foo/bar',[],1);" , sourceMap : undefined } ,
172- { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[\"loo\"],1);define('foo',['foo/index'],function(m){return m;});\n " , sourceMap : undefined } ,
173- { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});\n " , sourceMap : undefined } ,
172+ { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[\"loo\"],1);define('foo',['foo/index'],function(m){return m;});" , sourceMap : undefined } ,
173+ { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});" , sourceMap : undefined } ,
174174 { contents : 'define.switchToUserSpace();' } ,
175175 ]
176176 }
@@ -218,9 +218,9 @@ test('Bundler traces files, split bundles, case2', t => {
218218 'main' : {
219219 files : [
220220 { contents : 'var pre = 1;' } ,
221- { contents : 'setup' } ,
222- { contents : 'dumber-module-loader' } ,
223- { contents : 'after' } ,
221+ { contents : 'setup; ' } ,
222+ { contents : 'dumber-module-loader; ' } ,
223+ { contents : 'after; ' } ,
224224 { contents : 'var ape = 1;' } ,
225225 ] ,
226226 config : {
@@ -243,15 +243,15 @@ test('Bundler traces files, split bundles, case2', t => {
243243 { path : 'src/app.js' , contents : "define('app',[\"foo\",\"page/one\"],1);" , sourceMap : undefined } ,
244244 { path : 'src/page/one.js' , contents : "define('page/one',[\"foo/bar\",\"loo\"],1);" , sourceMap : undefined } ,
245245 { contents : 'define.switchToPackageSpace();' } ,
246- { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});\n " , sourceMap : undefined } ,
246+ { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});" , sourceMap : undefined } ,
247247 { contents : 'define.switchToUserSpace();' } ,
248248 ]
249249 } ,
250250 'vendor' : {
251251 files : [
252252 { contents : 'define.switchToPackageSpace();' } ,
253253 { path : 'node_modules/foo/bar.js' , contents : "define('foo/bar',[],1);" , sourceMap : undefined } ,
254- { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[\"loo\"],1);define('foo',['foo/index'],function(m){return m;});\n " , sourceMap : undefined } ,
254+ { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[\"loo\"],1);define('foo',['foo/index'],function(m){return m;});" , sourceMap : undefined } ,
255255 { contents : 'define.switchToUserSpace();' } ,
256256 ]
257257 }
@@ -285,12 +285,12 @@ test('Bundler traces files, sorts shim', t => {
285285 t . deepEqual ( bundleMap , {
286286 'entry-bundle' : {
287287 files : [
288- { contents : 'dumber-module-loader' } ,
288+ { contents : 'dumber-module-loader; ' } ,
289289 { contents : 'define.switchToUserSpace();' } ,
290290 { path : 'src/app.js' , contents : "define('app',[\"fs\",\"bootstrap\"],1);" , sourceMap : undefined } ,
291291 { contents : 'define.switchToPackageSpace();' } ,
292292 { path : 'node_modules/jquery/dist/jquery.js' , contents : 'define("jquery",[],1);' , sourceMap : undefined } ,
293- { path : 'node_modules/bootstrap/dist/bootstrap.js' , contents : "define('bootstrap/dist/bootstrap',[\"jquery\"],function(){return jQuery;});define('bootstrap',['bootstrap/dist/bootstrap'],function(m){return m;});\n " , sourceMap : undefined } ,
293+ { path : 'node_modules/bootstrap/dist/bootstrap.js' , contents : "define('bootstrap/dist/bootstrap',[\"jquery\"],function(){return jQuery;});define('bootstrap',['bootstrap/dist/bootstrap'],function(m){return m;});" , sourceMap : undefined } ,
294294 // mockTrace didn't touch fs stub, it is different in real usage
295295 { path : '__stub__/fs' , contents : "define(function(){return {};});" , sourceMap : undefined } ,
296296 { contents : 'define.switchToUserSpace();' } ,
@@ -326,7 +326,7 @@ test('Bundler ignores module when onRequire returns false', t => {
326326 t . deepEqual ( bundleMap , {
327327 'entry-bundle' : {
328328 files : [
329- { contents : 'dumber-module-loader' } ,
329+ { contents : 'dumber-module-loader; ' } ,
330330 { contents : 'define.switchToUserSpace();' } ,
331331 { path : 'src/app.js' , contents : "define('app',[\"foo\"],1);" , sourceMap : undefined } ,
332332 ] ,
@@ -365,12 +365,12 @@ test('Bundler replaces deps when onRequire returns array', t => {
365365 t . deepEqual ( bundleMap , {
366366 'entry-bundle' : {
367367 files : [
368- { contents : 'dumber-module-loader' } ,
368+ { contents : 'dumber-module-loader; ' } ,
369369 { contents : 'define.switchToUserSpace();' } ,
370370 { path : 'src/app.js' , contents : "define('app',[\"foo\"],1);" , sourceMap : undefined } ,
371371 { contents : 'define.switchToPackageSpace();' } ,
372- { path : 'node_modules/bar/index.js' , contents : "define('bar/index',[],1);define('bar',['bar/index'],function(m){return m;});\n " , sourceMap : undefined } ,
373- { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});\n " , sourceMap : undefined } ,
372+ { path : 'node_modules/bar/index.js' , contents : "define('bar/index',[],1);define('bar',['bar/index'],function(m){return m;});" , sourceMap : undefined } ,
373+ { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});" , sourceMap : undefined } ,
374374 { contents : 'define.switchToUserSpace();' } ,
375375 ] ,
376376 config : {
@@ -407,12 +407,12 @@ test('Bundler supports implementation returned by onRequire', t => {
407407 t . deepEqual ( bundleMap , {
408408 'entry-bundle' : {
409409 files : [
410- { contents : 'dumber-module-loader' } ,
410+ { contents : 'dumber-module-loader; ' } ,
411411 { contents : 'define.switchToUserSpace();' } ,
412412 { path : 'src/app.js' , contents : "define('app',[\"foo\"],1);" , sourceMap : undefined } ,
413413 { path : '__on_require__/foo' , contents : "define('foo',[\"loo\"],1);" , sourceMap : undefined } ,
414414 { contents : 'define.switchToPackageSpace();' } ,
415- { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});\n " , sourceMap : undefined } ,
415+ { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});" , sourceMap : undefined } ,
416416 { contents : 'define.switchToUserSpace();' } ,
417417 ] ,
418418 config : {
@@ -448,11 +448,11 @@ test('Bundler swallows onRequire exception', t => {
448448 t . deepEqual ( bundleMap , {
449449 'entry-bundle' : {
450450 files : [
451- { contents : 'dumber-module-loader' } ,
451+ { contents : 'dumber-module-loader; ' } ,
452452 { contents : 'define.switchToUserSpace();' } ,
453453 { path : 'src/app.js' , contents : "define('app',[\"foo\"],1);" , sourceMap : undefined } ,
454454 { contents : 'define.switchToPackageSpace();' } ,
455- { path : 'node_modules/foo/foo.js' , contents : "define('foo/foo',[],1);define('foo',['foo/foo'],function(m){return m;});\n " , sourceMap : undefined } ,
455+ { path : 'node_modules/foo/foo.js' , contents : "define('foo/foo',[],1);define('foo',['foo/foo'],function(m){return m;});" , sourceMap : undefined } ,
456456 { contents : 'define.switchToUserSpace();' } ,
457457 ] ,
458458 config : {
@@ -488,11 +488,11 @@ test('Bundler swallows onRequire promise rejection', t => {
488488 t . deepEqual ( bundleMap , {
489489 'entry-bundle' : {
490490 files : [
491- { contents : 'dumber-module-loader' } ,
491+ { contents : 'dumber-module-loader; ' } ,
492492 { contents : 'define.switchToUserSpace();' } ,
493493 { path : 'src/app.js' , contents : "define('app',[\"foo\"],1);" , sourceMap : undefined } ,
494494 { contents : 'define.switchToPackageSpace();' } ,
495- { path : 'node_modules/foo/foo.js' , contents : "define('foo/foo',[],1);define('foo',['foo/foo'],function(m){return m;});\n " , sourceMap : undefined } ,
495+ { path : 'node_modules/foo/foo.js' , contents : "define('foo/foo',[],1);define('foo',['foo/foo'],function(m){return m;});" , sourceMap : undefined } ,
496496 { contents : 'define.switchToUserSpace();' } ,
497497 ] ,
498498 config : {
@@ -558,7 +558,7 @@ test('Bundler traces files, split bundles, continuously update bundles in watch
558558 t . deepEqual ( bundleMap , {
559559 'entry-bundle' : {
560560 files : [
561- { contents : 'dumber-module-loader' }
561+ { contents : 'dumber-module-loader; ' }
562562 ] ,
563563 config : {
564564 baseUrl : 'dist' ,
@@ -593,7 +593,7 @@ test('Bundler traces files, split bundles, continuously update bundles in watch
593593 'vendor-bundle' : {
594594 files : [
595595 { contents : 'define.switchToPackageSpace();' } ,
596- { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[],1);define('foo',['foo/index'],function(m){return m;});\n " , sourceMap : undefined } ,
596+ { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[],1);define('foo',['foo/index'],function(m){return m;});" , sourceMap : undefined } ,
597597 { contents : 'define.switchToUserSpace();' }
598598 ]
599599 }
@@ -609,9 +609,9 @@ test('Bundler traces files, split bundles, continuously update bundles in watch
609609 t . deepEqual ( bundleMap , {
610610 'entry-bundle' : {
611611 files : [
612- { contents : 'dumber-module-loader' } ,
612+ { contents : 'dumber-module-loader; ' } ,
613613 { contents : 'define.switchToPackageSpace();' } ,
614- { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});\n " , sourceMap : undefined } ,
614+ { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});" , sourceMap : undefined } ,
615615 { contents : 'define.switchToUserSpace();' }
616616 ] ,
617617 config : {
@@ -642,7 +642,7 @@ test('Bundler traces files, split bundles, continuously update bundles in watch
642642 files : [
643643 { contents : 'define.switchToPackageSpace();' } ,
644644 { path : 'node_modules/foo/bar.js' , contents : "define('foo/bar',[],1);" , sourceMap : undefined } ,
645- { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[],1);define('foo',['foo/index'],function(m){return m;});\n " , sourceMap : undefined } ,
645+ { path : 'node_modules/foo/index.js' , contents : "define('foo/index',[],1);define('foo',['foo/index'],function(m){return m;});" , sourceMap : undefined } ,
646646 { contents : 'define.switchToUserSpace();' }
647647 ]
648648 }
@@ -659,9 +659,9 @@ test('Bundler traces files, split bundles, continuously update bundles in watch
659659 t . deepEqual ( bundleMap , {
660660 'entry-bundle' : {
661661 files : [
662- { contents : 'dumber-module-loader' } ,
662+ { contents : 'dumber-module-loader; ' } ,
663663 { contents : 'define.switchToPackageSpace();' } ,
664- { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});\n " , sourceMap : undefined } ,
664+ { path : 'node_modules/loo/loo.js' , contents : "define('loo/loo',[],1);define('loo',['loo/loo'],function(m){return m;});" , sourceMap : undefined } ,
665665 { contents : 'define.switchToUserSpace();' }
666666 ] ,
667667 config : {
0 commit comments