Skip to content

fixes https://github.com/TypeStrong/ts-loader/issues/1014#1015

Merged
johnnyreilly merged 3 commits intoTypeStrong:masterfrom
justweb:bufgix-1014
Sep 20, 2019
Merged

fixes https://github.com/TypeStrong/ts-loader/issues/1014#1015
johnnyreilly merged 3 commits intoTypeStrong:masterfrom
justweb:bufgix-1014

Conversation

@gvinaccia
Copy link
Contributor

it seems that ts-loader is trying to emit declaration files for a declaration file, this causes typescript's getOutputDeclarationFileName throw an error

}
if (
(configFile.options.declaration || configFile.options.composite) &&
(instance.compiler as any).hasTSFileExtension(inputFileName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to add this part to getEmitOutput to return [] early even before getting program rather than here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thank you

src/instances.ts Outdated
}

export function getEmitOutput(instance: TSInstance, filePath: string) {
if (fileExtensionIs(filePath, typescript.Extension.Dts)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry missed this earlier but for extension use instance.compiler.Extension.Dts typescript is used only for types for tsloader code.. The compiler = typescript of the compilation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks for your time

@johnnyreilly
Copy link
Member

This looks great!

@johnnyreilly
Copy link
Member

Build is only failing because #1016 isn't merged yet - merging this; will merge the other subsequently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants