Skip to content

Commit b3eb9c5

Browse files
committed
add 'emitReverseMapping' task to jakefile
1 parent 9295a0e commit b3eb9c5

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

Jakefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ function concatenateFiles(destinationFile, sourceFiles) {
134134
}
135135

136136
var useDebugMode = false;
137+
var emitReverseMapping = false;
137138
var generateDeclarations = false;
138139
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
139140
var compilerFilename = "tsc.js";
@@ -148,10 +149,14 @@ var compilerFilename = "tsc.js";
148149
function 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
261266
desc("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"
268277
task("default", ["local"]);

0 commit comments

Comments
 (0)