Closed
Description
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!
Metadata
Metadata
Assignees
Labels
No labels