diff --git a/Jakefile b/Jakefile index 665bb807b43..2eb87494f2f 100644 --- a/Jakefile +++ b/Jakefile @@ -222,15 +222,17 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; var options = "--module commonjs -noImplicitAny"; - if (!keepComments) { - options += " -removeComments"; + // Keep comments when specifically requested + // or when in debug mode. + if (!(keepComments || useDebugMode)) { + options += " --removeComments"; } if (generateDeclarations) { options += " --declaration"; } - if (useDebugMode || preserveConstEnums) { + if (preserveConstEnums || useDebugMode) { options += " --preserveConstEnums"; }