allow non ts files to be passed in to the compiler

This commit is contained in:
Mohamed Hegazy 2014-11-17 10:59:55 -08:00
parent 1986fb1a57
commit 0629bba5bf
2 changed files with 2 additions and 1 deletions

View File

@ -4328,7 +4328,7 @@ module ts {
}
var diagnostic: DiagnosticMessage;
if (hasExtension(filename)) {
if (!fileExtensionIs(filename, ".ts")) {
if (!options.allowNonTsExtensions && !fileExtensionIs(filename, ".ts")) {
diagnostic = Diagnostics.File_0_must_have_extension_ts_or_d_ts;
}
else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {

View File

@ -1152,6 +1152,7 @@ module ts {
version?: boolean;
watch?: boolean;
preserveConstEnums?: boolean;
allowNonTsExtensions?: boolean;
[option: string]: string | number | boolean;
}