@@ -134,6 +134,7 @@ function concatenateFiles(destinationFile, sourceFiles) {
134134}
135135
136136var useDebugMode = false ;
137+ var emitReverseMapping = false ;
137138var generateDeclarations = false ;
138139var host = ( process . env . host || process . env . TYPESCRIPT_HOST || "node" ) ;
139140var compilerFilename = "tsc.js" ;
@@ -148,10 +149,14 @@ var compilerFilename = "tsc.js";
148149function compileFile ( outFile , sources , prereqs , prefixes , useBuiltCompiler , noOutFile ) {
149150 file ( outFile , prereqs , function ( ) {
150151 var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory ;
151- var options = "-removeComments --module commonjs -noImplicitAny " ; //" -propagateEnumConstants "
152+ var options = "-removeComments --module commonjs -noImplicitAny " ;
152153 if ( generateDeclarations ) {
153154 options += "--declaration " ;
154155 }
156+
157+ if ( emitReverseMapping ) {
158+ options += "--preserveConstEnums " ;
159+ }
155160
156161 var cmd = host + " " + dir + compilerFilename + " " + options + " " ;
157162 if ( useDebugMode ) {
@@ -259,10 +264,14 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]);
259264
260265// Local target to build the compiler and services
261266desc ( "Emit debug mode files with sourcemaps" ) ;
262- task ( "debug" , function ( ) {
267+ task ( "debug" , [ "emitReverseMapping" ] , function ( ) {
263268 useDebugMode = true ;
264269} ) ;
265270
271+ desc ( "Emit reverse mapping for const enums" ) ;
272+ task ( "emitReverseMapping" , function ( ) {
273+ emitReverseMapping = true ;
274+ } ) ;
266275
267276// Set the default task to "local"
268277task ( "default" , [ "local" ] ) ;
0 commit comments