ts-checker-rspack-plugin 1.0.2 → 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 (tap.name === 'webpack-dev-server' && tap.type === 'sync' && config.devServer) {
11
- debug('Intercepting webpack-dev-server tap.');
12
- state.webpackDevServerDoneTap = tap;
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 webpack-dev-server, if it's listening
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.webpackDevServerDoneTap) {
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 webpack-dev-server.');
74
- state.webpackDevServerDoneTap.fn(stats);
73
+ debug('Sending issues to the dev-server.');
74
+ state.DevServerDoneTap.fn(stats);
75
75
  }
76
76
  });
77
77
  }
@@ -11,7 +11,7 @@ interface TsCheckerRspackPluginState {
11
11
  watching: boolean;
12
12
  initialized: boolean;
13
13
  iteration: number;
14
- webpackDevServerDoneTap: any | undefined;
14
+ DevServerDoneTap: any | undefined;
15
15
  }
16
16
  declare function createPluginState(): TsCheckerRspackPluginState;
17
17
  export { TsCheckerRspackPluginState, createPluginState };
@@ -11,7 +11,7 @@ function createPluginState() {
11
11
  watching: false,
12
12
  initialized: false,
13
13
  iteration: 0,
14
- webpackDevServerDoneTap: undefined,
14
+ DevServerDoneTap: undefined,
15
15
  };
16
16
  }
17
17
  exports.createPluginState = createPluginState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-checker-rspack-plugin",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "rspack",
@@ -44,6 +44,11 @@
44
44
  "@rspack/core": "^1.0.0",
45
45
  "typescript": ">=3.8.0"
46
46
  },
47
+ "peerDependenciesMeta": {
48
+ "@rspack/core": {
49
+ "optional": true
50
+ }
51
+ },
47
52
  "devDependencies": {
48
53
  "@jest/console": "^27.0.0",
49
54
  "@rspack/core": "^1.1.3",