Fix behavior for extensionless files with .mime file #1779
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1776
There are 2 separate issues addressed here that both contribute to the issue:
In rollup config file we failed to include
ts.Extension
, resulting ints.Extension
becomeundefined
in the bundle.In
js/compiler.ts
we did not specify that we allow files of non-TS extensions => This would result in the following lines to fail:https://github.com/Microsoft/TypeScript/blob/ed8c81a5638c7d745cb8541137ad6990da045467/src/compiler/program.ts#L2151-L2161
Without
allowNonTsExtensions
set to true in options, the compiler would try out all possible file names with extensions but never check the original extensionless one. This causes the behavior in debug log as mentioned in #1776 (comment)/cc @kitsonk