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; }