Skip to content

Commit 871bfe8

Browse files
authored
fix: require typescript@^3.8.0 for build: true mode (#672)
SolutionBuilder API is buggy for TypeScript < 3.8.0. To reduce maintenance burden, we bump minimal TypeScript version for { build: true } mode to 3.8.0. BREAKING CHANGE: 🧨 Minimal version of TypeScript with { build: true } mode changed from 3.6.0 to 3.8.0
1 parent ad466df commit 871bfe8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/typescript-reporter/TypeScriptSupport.ts

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ function assertTypeScriptSupport(configuration: TypeScriptReporterConfiguration)
2828
].join(os.EOL)
2929
);
3030
}
31+
if (configuration.build && semver.lt(typescriptVersion, '3.8.0')) {
32+
throw new Error(
33+
[
34+
`ForkTsCheckerWebpackPlugin doesn't support build option for the current typescript version of ${typescriptVersion}.`,
35+
'The minimum required version is 3.8.0.',
36+
].join(os.EOL)
37+
);
38+
}
3139

3240
if (!fs.existsSync(configuration.configFile)) {
3341
throw new Error(

test/e2e/TypeScriptSolutionBuilderApi.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import semver from 'semver';
44

55
describe('TypeScript SolutionBuilder API', () => {
66
it.each([
7-
{ async: false, typescript: '~3.6.0', mode: 'readonly' },
7+
{ async: false, typescript: '~3.8.0', mode: 'readonly' },
88
{ async: true, typescript: '~3.8.0', mode: 'write-tsbuildinfo' },
99
{ async: false, typescript: '~4.0.0', mode: 'write-references' },
1010
{ async: true, typescript: '~4.3.0', mode: 'readonly' },

0 commit comments

Comments
 (0)