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

Speculative fix for #565 #566

Merged
merged 4 commits into from
Jun 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ env:
- TYPESCRIPT=typescript@2.1.5
- TYPESCRIPT=typescript@2.2.1
- TYPESCRIPT=typescript@2.3.1
- TYPESCRIPT=typescript@2.4.1
# - TYPESCRIPT=typescript@next
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v2.2.1 - NOT RELEASED YET

- [Report errors in JS(X) files when CheckJS is enabled](https://github.com/TypeStrong/ts-loader/pull/564) - thanks @schmuli!
- [Cater for change to @types acquisition strategy in TypeScript 2.4.1](https://github.com/TypeStrong/ts-loader/pull/566) - thanks @johnnyreilly

## v2.2.0

Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ environment:
- TYPESCRIPT: typescript@2.1.5
- TYPESCRIPT: typescript@2.2.1
- TYPESCRIPT: typescript@2.3.1
- TYPESCRIPT: typescript@2.4.1
# - TYPESCRIPT: typescript@next
install:
- ps: Install-Product node $env:nodejs_version
Expand Down
6 changes: 6 additions & 0 deletions src/servicesHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ function makeServicesHost(
* For @types expansion, these two functions are needed.
*/
directoryExists: compiler.sys ? (<any> compiler.sys).directoryExists : undefined,

// The following three methods are necessary for @types resolution from TS 2.4.1 onwards see: https://github.com/Microsoft/TypeScript/issues/16772
fileExists: moduleResolutionHost.fileExists,
readFile: moduleResolutionHost.readFile,
readDirectory: compiler.sys ? (<any> compiler.sys).readDirectory : undefined,

getCurrentDirectory: () => process.cwd(),

getCompilationSettings: () => compilerOptions,
Expand Down