From 0629bba5bf985f99a8b6057695fa84c2e2b59eb9 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 17 Nov 2014 10:59:55 -0800 Subject: [PATCH] allow non ts files to be passed in to the compiler --- src/compiler/parser.ts | 2 +- src/compiler/types.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 2d7c9266f2b..ab78f74f29d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -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)) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c8f1c6d8b6a..5836f25891b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1152,6 +1152,7 @@ module ts { version?: boolean; watch?: boolean; preserveConstEnums?: boolean; + allowNonTsExtensions?: boolean; [option: string]: string | number | boolean; }