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

@gvinaccia gvinaccia commented Sep 20, 2019

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

@sheetalkamat sheetalkamat Sep 20, 2019

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

@gvinaccia gvinaccia Sep 20, 2019

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

@sheetalkamat sheetalkamat Sep 20, 2019

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

@gvinaccia gvinaccia Sep 20, 2019

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

johnnyreilly commented Sep 20, 2019

This looks great!

@johnnyreilly
Copy link
Member

johnnyreilly commented Sep 20, 2019

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

@johnnyreilly johnnyreilly merged commit dff1e17 into TypeStrong:master Sep 20, 2019
0 of 2 checks passed
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.

None yet

3 participants