fork-ts-checker-webpack-plugin 6.3.0 → 6.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -13
- package/lib/ForkTsCheckerWebpackPlugin.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -362,24 +362,37 @@ When we call this method with a [webpack compiler instance](https://webpack.js.o
|
|
|
362
362
|
[tapable](https://github.com/webpack/tapable) hooks where you can pass in your callbacks.
|
|
363
363
|
|
|
364
364
|
```js
|
|
365
|
-
|
|
365
|
+
// ./src/webpack/MyWebpackPlugin.js
|
|
366
366
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
367
367
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
class MyWebpackPlugin {
|
|
369
|
+
apply(compiler) {
|
|
370
|
+
const hooks = ForkTsCheckerWebpackPlugin.getCompilerHooks(compiler);
|
|
371
|
+
|
|
372
|
+
// log some message on waiting
|
|
373
|
+
hooks.waiting.tap('MyPlugin', () => {
|
|
374
|
+
console.log('waiting for issues');
|
|
375
|
+
});
|
|
376
|
+
// don't show warnings
|
|
377
|
+
hooks.issues.tap('MyPlugin', (issues) =>
|
|
378
|
+
issues.filter((issue) => issue.severity === 'error')
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
371
382
|
|
|
372
|
-
|
|
373
|
-
// **don't do this if already added through configuration**
|
|
374
|
-
new ForkTsCheckerWebpackPlugin().apply(compiler);
|
|
383
|
+
module.exports = MyWebpackPlugin;
|
|
375
384
|
|
|
376
|
-
//
|
|
377
|
-
const
|
|
385
|
+
// webpack.config.js
|
|
386
|
+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
387
|
+
const MyWebpackPlugin = require('./src/webpack/MyWebpackPlugin');
|
|
378
388
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
389
|
+
module.exports = {
|
|
390
|
+
/* ... */
|
|
391
|
+
plugins: [
|
|
392
|
+
new ForkTsCheckerWebpackPlugin(),
|
|
393
|
+
new MyWebpackPlugin()
|
|
394
|
+
]
|
|
395
|
+
};
|
|
383
396
|
```
|
|
384
397
|
|
|
385
398
|
## Typings
|
|
@@ -76,7 +76,7 @@ exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
|
76
76
|
/**
|
|
77
77
|
* Current version of the plugin
|
|
78
78
|
*/
|
|
79
|
-
ForkTsCheckerWebpackPlugin.version = '6.3.
|
|
79
|
+
ForkTsCheckerWebpackPlugin.version = '6.3.1'; // will be replaced by the @semantic-release/exec
|
|
80
80
|
/**
|
|
81
81
|
* Default pools for the plugin concurrency limit
|
|
82
82
|
*/
|