From ef90492f29ee00e11f0e8e70aed420f39cf37d3e Mon Sep 17 00:00:00 2001 From: Bill Ticehurst Date: Wed, 10 Feb 2016 19:17:54 -0800 Subject: [PATCH] Changed further defaults to CommonJS (cherry picked from commit 0e5a93b85aa6f6fa2f6d93870fa54c107fc1c566) --- src/compiler/checker.ts | 2 +- src/compiler/utilities.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 76323f83e08..8e2a41c1011 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -49,7 +49,7 @@ namespace ts { const compilerOptions = host.getCompilerOptions(); const languageVersion = compilerOptions.target || ScriptTarget.ES3; - const modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.None; + const modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.CommonJS; const allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ModuleKind.System; const emitResolver = createResolver(); diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 52f69b4e77c..22e690afcac 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2013,7 +2013,7 @@ namespace ts { export function getEmitModuleKind(compilerOptions: CompilerOptions) { return compilerOptions.module ? compilerOptions.module : - getEmitScriptTarget(compilerOptions) === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.None; + getEmitScriptTarget(compilerOptions) === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.CommonJS; } export interface EmitFileNames {