@@ -98,44 +98,43 @@ module.exports = function makeNodeTree(destinationPath) {
9898
9999 // HACK: workaround for Traceur behavior.
100100 // It expects all transpiled modules to contain this marker.
101- // TODO: remove this when we no longer use traceur
101+ // TODO: remove this when we no longer use traceur
102102 var traceurCompatibleTsModulesTree = replace ( modulesTree , {
103103 files : [ '**/*.ts' ] ,
104104 patterns : [ {
105105 // Empty replacement needed so that replaceWithPath gets triggered...
106106 match : / $ / g,
107107 replacement : ""
108108 } ] ,
109- replaceWithPath : ( path , content ) => {
109+ replaceWithPath : function ( path , content ) {
110110 if ( ! path . endsWith ( '.d.ts' ) ) {
111- content += '\r\nexport var __esModule = true;\n' ;
111+ content += '\r\nexport var __esModule = true;\n' ;
112112 }
113113 return content ;
114- }
115- } ) ;
116-
117- var typescriptTree = compileWithTypescript ( traceurCompatibleTsModulesTree , {
118- allowNonTsExtensions : false ,
119- emitDecoratorMetadata : true ,
120- declaration : true ,
121- mapRoot : '' , /* force sourcemaps to use relative path */
122- module : 'commonjs' ,
123- noEmitOnError : true ,
124- rootDir : '.' ,
125- rootFilePaths : [ 'angular2/traceur-runtime.d.ts' , 'angular2/globals.d.ts' ] ,
126- sourceMap : true ,
127- sourceRoot : '.' ,
128- target : 'ES5'
129- } ) ;
130-
131-
132- nodeTree = mergeTrees ( [ nodeTree , typescriptTree , docs , packageJsons ] ) ;
133-
134- // TODO(iminar): tree differ seems to have issues with trees created by mergeTrees, investigate!
135- // ENOENT error is thrown while doing fs.readdirSync on inputRoot
136- // in the meantime, we just do noop mv to create a new tree
137- nodeTree = stew . mv ( nodeTree , '' ) ;
138-
139- return destCopy ( nodeTree , destinationPath ) ;
140- }
141- ;
114+ }
115+ } ) ;
116+
117+ var typescriptTree = compileWithTypescript ( traceurCompatibleTsModulesTree , {
118+ allowNonTsExtensions : false ,
119+ emitDecoratorMetadata : true ,
120+ declaration : true ,
121+ mapRoot : '' , /* force sourcemaps to use relative path */
122+ module : 'commonjs' ,
123+ noEmitOnError : true ,
124+ rootDir : '.' ,
125+ rootFilePaths : [ 'angular2/traceur-runtime.d.ts' , 'angular2/globals.d.ts' ] ,
126+ sourceMap : true ,
127+ sourceRoot : '.' ,
128+ target : 'ES5'
129+ } ) ;
130+
131+
132+ nodeTree = mergeTrees ( [ nodeTree , typescriptTree , docs , packageJsons ] ) ;
133+
134+ // TODO(iminar): tree differ seems to have issues with trees created by mergeTrees, investigate!
135+ // ENOENT error is thrown while doing fs.readdirSync on inputRoot
136+ // in the meantime, we just do noop mv to create a new tree
137+ nodeTree = stew . mv ( nodeTree , '' ) ;
138+
139+ return destCopy ( nodeTree , destinationPath ) ;
140+ } ;
0 commit comments