1- var getXhr , fetchText , _buildMap = { } ;
1+ var fetchText , _buildMap = { } ;
22
33if ( typeof window !== "undefined" && window . navigator && window . document ) {
4- getXhr = function ( ) {
5- return new XMLHttpRequest ( ) ;
6- } ;
7-
84 fetchText = function ( url , callback ) {
9- var xhr = getXhr ( ) ;
5+ var xhr = new XMLHttpRequest ( ) ;
106 xhr . open ( 'GET' , url , true ) ;
117 xhr . onreadystatechange = function ( evt ) {
128 //Do not explicitly handle errors, those should be
@@ -17,7 +13,6 @@ if (typeof window !== "undefined" && window.navigator && window.document) {
1713 } ;
1814 xhr . send ( null ) ;
1915 } ;
20-
2116} else if ( typeof process !== "undefined" &&
2217 process . versions &&
2318 ! ! process . versions . node ) {
@@ -31,11 +26,11 @@ if (typeof window !== "undefined" && window.navigator && window.document) {
3126define ( [ 'babel' ] , function ( babel ) {
3227 return {
3328 load : function ( name , req , onload , config ) {
34- var url = req . toUrl ( name + '.js' ) ,
35- code ;
29+ var url = req . toUrl ( name + '.js' ) ;
3630
3731 fetchText ( url , function ( text ) {
38- code = babel . transform ( text , {
32+ var code = babel . transform ( text , {
33+ modules : 'amd' ,
3934 sourceMap : 'inline'
4035 } ) . code ;
4136
0 commit comments