mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
use debug mode by defauls in local builds
This commit is contained in:
@@ -133,8 +133,7 @@ function concatenateFiles(destinationFile, sourceFiles) {
|
||||
fs.renameSync(temp, destinationFile);
|
||||
}
|
||||
|
||||
var useDebugMode = false;
|
||||
var emitReverseMapping = false;
|
||||
var useDebugMode = true;
|
||||
var generateDeclarations = false;
|
||||
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
|
||||
var compilerFilename = "tsc.js";
|
||||
@@ -154,14 +153,11 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
|
||||
options += "--declaration ";
|
||||
}
|
||||
|
||||
if (emitReverseMapping) {
|
||||
if (useDebugMode) {
|
||||
options += "--preserveConstEnums ";
|
||||
}
|
||||
|
||||
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
|
||||
if (useDebugMode) {
|
||||
cmd = cmd + " " + path.join(harnessDirectory, "external/es5compat.ts") + " " + path.join(harnessDirectory, "external/json2.ts") + " ";
|
||||
}
|
||||
cmd = cmd + sources.join(" ") + (!noOutFile ? " -out " + outFile : "");
|
||||
if (useDebugMode) {
|
||||
cmd = cmd + " -sourcemap -mapRoot file:///" + path.resolve(path.dirname(outFile));
|
||||
@@ -263,14 +259,9 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]);
|
||||
|
||||
|
||||
// Local target to build the compiler and services
|
||||
desc("Emit debug mode files with sourcemaps");
|
||||
task("debug", ["emitReverseMapping"], function() {
|
||||
useDebugMode = true;
|
||||
});
|
||||
|
||||
desc("Emit reverse mapping for const enums");
|
||||
task("emitReverseMapping", function() {
|
||||
emitReverseMapping = true;
|
||||
desc("Sets release mode flag");
|
||||
task("release", function() {
|
||||
useDebugMode = false;
|
||||
});
|
||||
|
||||
// Set the default task to "local"
|
||||
@@ -321,7 +312,7 @@ task("generate-spec", [specMd])
|
||||
|
||||
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
|
||||
desc("Makes a new LKG out of the built js files");
|
||||
task("LKG", libraryTargets, function() {
|
||||
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
|
||||
var expectedFiles = [tscFile, servicesFile].concat(libraryTargets);
|
||||
var missingFiles = expectedFiles.filter(function (f) {
|
||||
return !fs.existsSync(f);
|
||||
|
||||
Reference in New Issue
Block a user