Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 20, 2019

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

src/instances.ts Outdated
@@ -507,7 +507,11 @@ function getOutputFileNames(
}
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
@@ -567,6 +567,9 @@ export function isReferencedFile(instance: TSInstance, filePath: string) {
}

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