|
15 | 15 |
|
16 | 16 | ## Installation |
17 | 17 |
|
18 | | -This plugin requires minimum **webpack 2.3**, **TypeScript 2.1** and optionally **ESLint 6.0.0** or **TSLint 4.0** |
| 18 | +This plugin requires minimum **webpack 4.0**, **TypeScript 2.1** and optionally **ESLint 6.0.0** or **TSLint 4.0** |
| 19 | + |
| 20 | +If you depend on **webpack 2.0** or **webpack 3.0**, please use [older version](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v3.1.1) of the plugin. |
19 | 21 |
|
20 | 22 | ```sh |
21 | 23 | # with npm |
@@ -273,26 +275,21 @@ We hope this will be resolved in future; the issue can be tracked [here](https:/ |
273 | 275 |
|
274 | 276 | This plugin provides some custom webpack hooks (all are sync): |
275 | 277 |
|
276 | | -| Event name | Hook Access Key | Description | Params | |
277 | | -| --------------------------------------- | -------------------- | ------------------------------------------------------------------------------ | ------------------------------------------- | |
278 | | -| `fork-ts-checker-cancel` | `cancel` | Cancellation has been requested | `cancellationToken` | |
279 | | -| `fork-ts-checker-waiting` | `waiting` | Waiting for results | `hasTsLint` | |
280 | | -| `fork-ts-checker-service-before-start` | `serviceBeforeStart` | Async plugin that can be used for delaying `fork-ts-checker-service-start` | - | |
281 | | -| `fork-ts-checker-service-start` | `serviceStart` | Service will be started | `tsconfigPath`, `tslintPath`, `memoryLimit` | |
282 | | -| `fork-ts-checker-service-start-error` | `serviceStartError` | Cannot start service | `error` | |
283 | | -| `fork-ts-checker-service-out-of-memory` | `serviceOutOfMemory` | Service is out of memory | - | |
284 | | -| `fork-ts-checker-receive` | `receive` | Plugin receives diagnostics and lints from service | `diagnostics`, `lints` | |
285 | | -| `fork-ts-checker-emit` | `emit` | Service will add errors and warnings to webpack compilation ('build' mode) | `diagnostics`, `lints`, `elapsed` | |
286 | | -| `fork-ts-checker-done` | `done` | Service finished type checking and webpack finished compilation ('watch' mode) | `diagnostics`, `lints`, `elapsed` | |
287 | | - |
288 | | -The **Event name** is there for backward compatibility with webpack 2/3. Regardless |
289 | | -of the version of webpack (2, 3 or 4) you are using, we will always access plugin hooks with **Hook Access Keys** as |
290 | | -described below. |
| 278 | +| Hook Access Key | Description | Params | |
| 279 | +| -------------------- | ------------------------------------------------------------------------------ | ------------------------------------------- | |
| 280 | +| `cancel` | Cancellation has been requested | `cancellationToken` | |
| 281 | +| `waiting` | Waiting for results | `hasTsLint` | |
| 282 | +| `serviceBeforeStart` | Async plugin that can be used for delaying `fork-ts-checker-service-start` | - | |
| 283 | +| `serviceStart` | Service will be started | `tsconfigPath`, `tslintPath`, `memoryLimit` | |
| 284 | +| `serviceStartError` | Cannot start service | `error` | |
| 285 | +| `serviceOutOfMemory` | Service is out of memory | - | |
| 286 | +| `receive` | Plugin receives diagnostics and lints from service | `diagnostics`, `lints` | |
| 287 | +| `emit` | Service will add errors and warnings to webpack compilation ('build' mode) | `diagnostics`, `lints`, `elapsed` | |
| 288 | +| `done` | Service finished type checking and webpack finished compilation ('watch' mode) | `diagnostics`, `lints`, `elapsed` | |
291 | 289 |
|
292 | 290 | ### Accessing plugin hooks |
293 | 291 |
|
294 | | -All plugin hooks are compatible with both [webpack](https://webpack.js.org) version |
295 | | -4 and version 2. To access plugin hooks and tap into the event, we need to use |
| 292 | +To access plugin hooks and tap into the event, we need to use |
296 | 293 | the `getCompilerHooks` static method. When we call this method with a [webpack compiler instance](https://webpack.js.org/api/node/), |
297 | 294 | it returns the series of [tapable](https://github.com/webpack/tapable) |
298 | 295 | hooks where you can pass in your callbacks. |
|
0 commit comments