Merge pull request #2302 from NativeScript/cankov/transpile-emits-on-errors

Transpile should be allowed to emit on errors
This commit is contained in:
Panayot Cankov
2016-06-14 14:36:19 +03:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -56,6 +56,7 @@ function transpile(fileNames, options) {
});
console.timeEnd("transpile");
if (isWatching) {
// NOTE: Perhaps on file change before incremental compilation we should read the tsconfig.json again and update only tsconfig.json files.
console.log("Watching for changes...");
fs.watch(".", { persistent: true, recursive: true, encoding: "utf8" }, function (event, file) {
try {
@@ -110,12 +111,11 @@ function compile(fileNames, options) {
console.log("Process exiting with code " + exitCode + ".");
process.exit(exitCode);
}
// Perhaps on file change before incremental compilation we should read the tsconfig.json again.
var configFileName = path.resolve("tsconfig.json");
var configObject = JSON.parse(fs.readFileSync("./tsconfig.json"));
var configParseResult = ts.parseJsonConfigFileContent(configObject, ts.sys, path.dirname(configFileName));
configParseResult.fileNames.forEach(console.log);
if (isTranspile) {
configParseResult.options.noEmitOnError = false;
transpile(configParseResult.fileNames, configParseResult.options);
}
else {

View File

@@ -139,6 +139,7 @@ var configObject = JSON.parse(fs.readFileSync("./tsconfig.json"));
var configParseResult = ts.parseJsonConfigFileContent(configObject, ts.sys, path.dirname(configFileName));
if (isTranspile) {
configParseResult.options.noEmitOnError = false;
transpile(configParseResult.fileNames, configParseResult.options);
} else {
compile(configParseResult.fileNames, configParseResult.options);