Skip to content

Commit d056616

Browse files
authored
feat: remove "incremental: true" from ts default options (#444)
As incremental mode has some assumptions regarding changes that can occur in the project, sometimes the user has to remove .tsbuildinfo files manually to fix it. Because of that, we should not enable incremental mode by default - it should be a conscious choice of the user. BREAKING CHANGE: 🧨 Remove "incremental: true" from default typescript options
1 parent 188d44d commit d056616

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,18 @@ Options passed to the plugin constructor will overwrite options from the cosmico
153153

154154
Options for the TypeScript checker (`typescript` option object).
155155

156-
| Name | Type | Default value | Description |
157-
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
158-
| `enabled` | `boolean` | `true` | If `true`, it enables TypeScript checker. |
159-
| `memoryLimit` | `number` | `2048` | Memory limit for the checker process in MB. If the process exits with the allocation failed error, try to increase this number. |
160-
| `configFile` | `string` | `'tsconfig.json'` | Path to the `tsconfig.json` file (path relative to the `compiler.options.context` or absolute path) |
161-
| `configOverwrite` | `object` | `{ compilerOptions: { skipLibCheck: true, sourceMap: false, inlineSourceMap: false, incremental: true } }` | This configuration will overwrite configuration from the `tsconfig.json` file. Supported fields are: `extends`, `compilerOptions`, `include`, `exclude`, `files`, and `references`. |
162-
| `context` | `string` | `dirname(configuration.configFile)` | The base path for finding files specified in the `tsconfig.json`. Same as the `context` option from the [ts-loader](https://github.com/TypeStrong/ts-loader#context). Useful if you want to keep your `tsconfig.json` in an external package. Keep in mind that **not** having a `tsconfig.json` in your project root can cause different behaviour between `fork-ts-checker-webpack-plugin` and `tsc`. When using editors like `VS Code` it is advised to add a `tsconfig.json` file to the root of the project and extend the config file referenced in option `configFile`. |
163-
| `build` | `boolean` | `false` | The equivalent of the `--build` flag for the `tsc` command. |
164-
| `mode` | `'readonly'` or `'write-tsbuildinfo'` or `'write-references'` | `'write-tsbuildinfo'` | If you use the `babel-loader`, it's recommended to use `write-references` mode to improve initial compilation time. If you use `ts-loader`, it's recommended to use `write-tsbuildinfo` mode to not overwrite filed emitted by the `ts-loader`. |
165-
| `diagnosticsOptions` | `object` | `{ syntactic: false, semantic: true, declaration: false, global: false }` | Settings to select which diagnostics do we want to perform. |
166-
| `extensions` | `object` | `{}` | See [TypeScript extensions options](#typescript-extensions-options). |
167-
| `profile` | `boolean` | `false` | Measures and prints timings related to the TypeScript performance. |
156+
| Name | Type | Default value | Description |
157+
| -------------------- | --------- | -------------------------------------------------------------------------------------------------------------- | ----------- |
158+
| `enabled` | `boolean` | `true` | If `true`, it enables TypeScript checker. |
159+
| `memoryLimit` | `number` | `2048` | Memory limit for the checker process in MB. If the process exits with the allocation failed error, try to increase this number. |
160+
| `configFile` | `string` | `'tsconfig.json'` | Path to the `tsconfig.json` file (path relative to the `compiler.options.context` or absolute path) |
161+
| `configOverwrite` | `object` | `{ compilerOptions: { skipLibCheck: true, sourceMap: false, inlineSourceMap: false, declarationMap: false } }` | This configuration will overwrite configuration from the `tsconfig.json` file. Supported fields are: `extends`, `compilerOptions`, `include`, `exclude`, `files`, and `references`. |
162+
| `context` | `string` | `dirname(configuration.configFile)` | The base path for finding files specified in the `tsconfig.json`. Same as the `context` option from the [ts-loader](https://github.com/TypeStrong/ts-loader#context). Useful if you want to keep your `tsconfig.json` in an external package. Keep in mind that **not** having a `tsconfig.json` in your project root can cause different behaviour between `fork-ts-checker-webpack-plugin` and `tsc`. When using editors like `VS Code` it is advised to add a `tsconfig.json` file to the root of the project and extend the config file referenced in option `configFile`. |
163+
| `build` | `boolean` | `false` | The equivalent of the `--build` flag for the `tsc` command. |
164+
| `mode` | `'readonly'` or `'write-tsbuildinfo'` or `'write-references'` | `'write-tsbuildinfo'` | If you use the `babel-loader`, it's recommended to use `write-references` mode to improve initial compilation time. If you use `ts-loader`, it's recommended to use `write-tsbuildinfo` mode to not overwrite filed emitted by the `ts-loader`. |
165+
| `diagnosticsOptions` | `object` | `{ syntactic: false, semantic: true, declaration: false, global: false }` | Settings to select which diagnostics do we want to perform. |
166+
| `extensions` | `object` | `{}` | See [TypeScript extensions options](#typescript-extensions-options). |
167+
| `profile` | `boolean` | `false` | Measures and prints timings related to the TypeScript performance. |
168168

169169
#### TypeScript extensions options
170170

src/typescript-reporter/TypeScriptReporterConfiguration.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ function createTypeScriptReporterConfiguration(
5050
if (semver.gte(ts.version, '2.9.0')) {
5151
defaultCompilerOptions.declarationMap = false;
5252
}
53-
if (semver.gte(ts.version, '3.4.0')) {
54-
defaultCompilerOptions.incremental = true;
55-
}
5653

5754
return {
5855
enabled: options !== false,

test/unit/typescript-reporter/TypeScriptReporterConfiguration.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe('typescript-reporter/TypeScriptsReporterConfiguration', () => {
1818
sourceMap: false,
1919
inlineSourceMap: false,
2020
declarationMap: false,
21-
incremental: true,
2221
},
2322
},
2423
context: path.normalize(path.dirname(path.resolve(context, 'tsconfig.json'))),
@@ -85,7 +84,6 @@ describe('typescript-reporter/TypeScriptsReporterConfiguration', () => {
8584
sourceMap: false,
8685
inlineSourceMap: false,
8786
declarationMap: false,
88-
incremental: true,
8987
strict: true,
9088
},
9189
include: ['src'],

0 commit comments

Comments
 (0)