When setting allowJs: true in tsconfig.json, typescript files can import javascript files.
Typescript is also clever about the types used in javascript and infers as much as possible.
Such inferred javascript types might even be exported by typescript files and become part of the library API.
Expected Behaviour
ts-loader should emit declaration files for javascript files when allowJs is set to true and ts-loader is configured to handle javascript files.
Actual Behaviour
ts-loader does not emit declaration files for javascript files that are imported in typescript files. This results in broken declaration files.
Steps to Reproduce the Problem
- clone https://github.com/hediet/webpack-allowjs-declaration-issue-repro
- run
yarn
- run
yarn build
- Notice this error (no declaration files for javascript):

Location of a Minimal Repository that Demonstrates the Issue.
https://github.com/hediet/webpack-allowjs-declaration-issue-repro
Btw., thanks for creating and maintaining ts-loader!
When setting
allowJs: trueintsconfig.json, typescript files can import javascript files.Typescript is also clever about the types used in javascript and infers as much as possible.
Such inferred javascript types might even be exported by typescript files and become part of the library API.
Expected Behaviour
ts-loadershould emit declaration files for javascript files whenallowJsis set totrueandts-loaderis configured to handle javascript files.Actual Behaviour
ts-loaderdoes not emit declaration files for javascript files that are imported in typescript files. This results in broken declaration files.Steps to Reproduce the Problem
yarnyarn buildLocation of a Minimal Repository that Demonstrates the Issue.
https://github.com/hediet/webpack-allowjs-declaration-issue-repro
Btw., thanks for creating and maintaining ts-loader!