Merge pull request #1471 from Microsoft/preserveConstEnumsInServices
Preserve const enums in typescriptServices.js
This commit is contained in:
commit
004cea8293
1 changed files with 12 additions and 3 deletions
15
Jakefile
15
Jakefile
|
@ -181,7 +181,7 @@ var compilerFilename = "tsc.js";
|
|||
* @param keepComments: false to compile using --removeComments
|
||||
* @param callback: a function to execute after the compilation process ends
|
||||
*/
|
||||
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile, generateDeclarations, outDir, keepComments, noResolve, callback) {
|
||||
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile, generateDeclarations, outDir, preserveConstEnums, keepComments, noResolve, callback) {
|
||||
file(outFile, prereqs, function() {
|
||||
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
|
||||
var options = "--module commonjs -noImplicitAny";
|
||||
|
@ -194,7 +194,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
|
|||
options += " --declaration";
|
||||
}
|
||||
|
||||
if (useDebugMode) {
|
||||
if (useDebugMode || preserveConstEnums) {
|
||||
options += " --preserveConstEnums";
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,15 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
|
|||
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
|
||||
|
||||
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
|
||||
compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources), [copyright], /*useBuiltCompiler*/ true);
|
||||
compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources),
|
||||
/*prefixes*/ [copyright],
|
||||
/*useBuiltCompiler*/ true,
|
||||
/*noOutFile*/ false,
|
||||
/*generateDeclarations*/ false,
|
||||
/*outDir*/ undefined,
|
||||
/*preserveConstEnums*/ true,
|
||||
/*keepComments*/ false,
|
||||
/*noResolve*/ false);
|
||||
|
||||
var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");
|
||||
var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
|
||||
|
@ -321,6 +329,7 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
|
|||
/*noOutFile*/ true,
|
||||
/*generateDeclarations*/ true,
|
||||
/*outDir*/ tempDirPath,
|
||||
/*preserveConstEnums*/ true,
|
||||
/*keepComments*/ true,
|
||||
/*noResolve*/ true,
|
||||
/*callback*/ function () {
|
||||
|
|
Loading…
Reference in a new issue