ts-checker-rspack-plugin 1.0.3 → 1.1.0
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
CHANGED
|
@@ -94,7 +94,7 @@ Rspack's modules resolution**. It means that you have to setup `tsconfig.json` c
|
|
|
94
94
|
| `issue` | `object` | `{}` | See [Issues options](#issues-options). |
|
|
95
95
|
| `formatter` | `string` or `object` or `function` | `codeframe` | Available formatters are `basic`, `codeframe` and a custom `function`. To [configure](https://babeljs.io/docs/en/babel-code-frame#options) `codeframe` formatter, pass: `{ type: 'codeframe', options: { <coderame options> } }`. To use absolute file path, pass: `{ type: 'codeframe', pathType: 'absolute' }`. |
|
|
96
96
|
| `logger` | `{ log: function, error: function }` or `webpack-infrastructure` | `console` | Console-like object to print issues in `async` mode. |
|
|
97
|
-
| `devServer` | `boolean` | `true` | If set to `false`, errors will not be reported to Dev Server. |
|
|
97
|
+
| `devServer` | `boolean` | `true` | If set to `false`, errors will not be reported to Dev Server and displayed in the error overlay. |
|
|
98
98
|
|
|
99
99
|
### TypeScript options
|
|
100
100
|
|
|
@@ -7,9 +7,9 @@ function interceptDoneToGetDevServerTap(compiler, config, state) {
|
|
|
7
7
|
// inspired by https://github.com/ypresto/fork-ts-checker-async-overlay-webpack-plugin
|
|
8
8
|
compiler.hooks.done.intercept({
|
|
9
9
|
register: (tap) => {
|
|
10
|
-
if (
|
|
11
|
-
debug('Intercepting
|
|
12
|
-
state.
|
|
10
|
+
if (['webpack-dev-server', 'rsbuild-dev-server'].includes(tap.name) && tap.type === 'sync' && config.devServer) {
|
|
11
|
+
debug('Intercepting dev-server tap.');
|
|
12
|
+
state.DevServerDoneTap = tap;
|
|
13
13
|
}
|
|
14
14
|
return tap;
|
|
15
15
|
},
|
|
@@ -58,9 +58,9 @@ function tapDoneToAsyncGetIssues(compiler, config, state) {
|
|
|
58
58
|
else {
|
|
59
59
|
config.logger.log(picocolors_1.default.green('No errors found.'));
|
|
60
60
|
}
|
|
61
|
-
// report issues to
|
|
61
|
+
// report issues to dev-server (overlay), if it's listening
|
|
62
62
|
// skip reporting if there are no issues, to avoid an extra hot reload
|
|
63
|
-
if (issues.length && state.
|
|
63
|
+
if (issues.length && state.DevServerDoneTap) {
|
|
64
64
|
issues.forEach((issue) => {
|
|
65
65
|
const error = new issue_webpack_error_1.IssueWebpackError(config.formatter.format(issue), config.formatter.pathType, issue);
|
|
66
66
|
if (issue.severity === 'warning') {
|
|
@@ -70,8 +70,8 @@ function tapDoneToAsyncGetIssues(compiler, config, state) {
|
|
|
70
70
|
stats.compilation.errors.push(error);
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
debug('Sending issues to the
|
|
74
|
-
state.
|
|
73
|
+
debug('Sending issues to the dev-server.');
|
|
74
|
+
state.DevServerDoneTap.fn(stats);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}
|
package/lib/plugin-state.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ interface TsCheckerRspackPluginState {
|
|
|
11
11
|
watching: boolean;
|
|
12
12
|
initialized: boolean;
|
|
13
13
|
iteration: number;
|
|
14
|
-
|
|
14
|
+
DevServerDoneTap: any | undefined;
|
|
15
15
|
}
|
|
16
16
|
declare function createPluginState(): TsCheckerRspackPluginState;
|
|
17
17
|
export { TsCheckerRspackPluginState, createPluginState };
|
package/lib/plugin-state.js
CHANGED