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

Investigate altering extension priorities for wildcard loading #33623

Open
weswigham opened this issue Sep 26, 2019 · 0 comments
Open

Investigate altering extension priorities for wildcard loading #33623

weswigham opened this issue Sep 26, 2019 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Milestone

Comments

@weswigham
Copy link
Member

Our rules for loading files from wildcard matches prioritize .d.ts files over .json files (and at the same priority as .js files). Now that we support declaration files for .json and .js files, this is undesirable, as when declarations are emitted in-place (ie, with emitDeclarationsOnly), subsequent compilations using wildcard lookups will load the generated declaration files over the original source .js (maybe) and .json (definitely) files. Fixing this would require rejiggering the extension priority machinery in src\compiler\utilities.ts, so that declaration files are truly the lowest priority extension to load. This comment thread has a bit more discussion on the topic. A cursory glance also leads me to believe that extension priorities for extraFileExtensions as passed into getSupportedExtensions are largely unhandled, so there's probably a fair chunk of work here to revisit this system.

In the meantime, if you encounter an issue likely caused by this discrepancy, the workaround is pretty simple: Use the outDir compiler option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants