Add an additional check for js files before reusing isExternalLibaryImport (#620) #622
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.
Fixes #620 by only reusing Typscript's isExternalLibraryImport designation if the loader-resolved module is a JS file and not a TS file.
Added a comparison-test rather than an execution-test as this really is just a question of "does it compile" rather than changing any behavior related to the generated JS.
Note that this also locks typescript down to 2.4.2 because right now building from a clean clone fails. Since typescript is currently ^2.4.0 it upgraded locally to the latest - 2.5.2 - and since 2.5.x updates some general typings (in this case System.readFile) that causes a build failure in config.ts. Not sure how you guys want to deal with that - it seemed outside the scope of my change to fix that but it did look fairly simple.
Please let me know what you're thinking!
-Will