Merge pull request #7923 from Microsoft/Fix7922

Only bundle if module==AMD or module==System
This commit is contained in:
Mohamed Hegazy committed 2016-04-07 09:26:49 -07:00
commit 843f229f2a
3 files changed
+4 -6

No files matched your search

+3 -1
View File
@@ -2285,10 +2285,12 @@ namespace ts {
}
function onBundledEmit(host: EmitHost) {
const moduleKind = getEmitModuleKind(options);
const moduleEmitEnabled = moduleKind === ModuleKind.AMD || moduleKind === ModuleKind.System;
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
const bundledSources = filter(host.getSourceFiles(), sourceFile =>
!isDeclarationFile(sourceFile) // Not a declaration file
&& (!isExternalModule(sourceFile) || !!getEmitModuleKind(options))); // and not a module, unless module emit enabled
&& (!isExternalModule(sourceFile) || moduleEmitEnabled)); // and not a module, unless module emit enabled
if (bundledSources.length) {
const jsFilePath = options.outFile || options.out;