From b3be3192e5d9a26015c82b2680a271f0fb479600 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 28 Jun 2017 14:05:54 +0100 Subject: [PATCH 1/4] Speculative fix for #565 --- src/servicesHost.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/servicesHost.ts b/src/servicesHost.ts index d59408d68..1bc44554c 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -63,6 +63,12 @@ function makeServicesHost( * For @types expansion, these two functions are needed. */ directoryExists: compiler.sys ? ( 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 ? ( compiler.sys).readDirectory : undefined, + getCurrentDirectory: () => process.cwd(), getCompilationSettings: () => compilerOptions, From 168ae3357d06791845358166819c182a3f82bea0 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 28 Jun 2017 14:06:37 +0100 Subject: [PATCH 2/4] Added 2.4.1 to the build matrix --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index f1c48e457..461c7da5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 From c4e59349ba504959e365c8d903b216c93ecb25d3 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 28 Jun 2017 14:06:57 +0100 Subject: [PATCH 3/4] Added 2.4.1 to the build matrix --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 6a6f9111a..88a47eb77 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 From a97ab7fd18ba2a3438008f57451031d70170665f Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 28 Jun 2017 16:53:58 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dc076ef5..638641b94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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