ts-checker-rspack-plugin 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +216 -0
- package/lib/files-change.d.ts +17 -0
- package/lib/files-change.js +57 -0
- package/lib/files-match.d.ts +7 -0
- package/lib/files-match.js +2 -0
- package/lib/formatter/basic-formatter.d.ts +3 -0
- package/lib/formatter/basic-formatter.js +13 -0
- package/lib/formatter/code-frame-formatter.d.ts +4 -0
- package/lib/formatter/code-frame-formatter.js +29 -0
- package/lib/formatter/formatter-config.d.ts +8 -0
- package/lib/formatter/formatter-config.js +36 -0
- package/lib/formatter/formatter-options.d.ts +14 -0
- package/lib/formatter/formatter-options.js +2 -0
- package/lib/formatter/formatter.d.ts +4 -0
- package/lib/formatter/formatter.js +2 -0
- package/lib/formatter/index.d.ts +6 -0
- package/lib/formatter/index.js +18 -0
- package/lib/formatter/stats-formatter.d.ts +3 -0
- package/lib/formatter/stats-formatter.js +28 -0
- package/lib/formatter/types/babel__code-frame.d.ts +21 -0
- package/lib/formatter/types/babel__code-frame.js +7 -0
- package/lib/formatter/webpack-formatter.d.ts +3 -0
- package/lib/formatter/webpack-formatter.js +32 -0
- package/lib/hooks/intercept-done-to-get-dev-server-tap.d.ts +5 -0
- package/lib/hooks/intercept-done-to-get-dev-server-tap.js +18 -0
- package/lib/hooks/tap-after-compile-to-add-dependencies.d.ts +5 -0
- package/lib/hooks/tap-after-compile-to-add-dependencies.js +31 -0
- package/lib/hooks/tap-after-compile-to-get-issues.d.ts +5 -0
- package/lib/hooks/tap-after-compile-to-get-issues.js +52 -0
- package/lib/hooks/tap-after-environment-to-patch-watching.d.ts +4 -0
- package/lib/hooks/tap-after-environment-to-patch-watching.js +22 -0
- package/lib/hooks/tap-done-to-async-get-issues.d.ts +5 -0
- package/lib/hooks/tap-done-to-async-get-issues.js +86 -0
- package/lib/hooks/tap-error-to-log-message.d.ts +4 -0
- package/lib/hooks/tap-error-to-log-message.js +32 -0
- package/lib/hooks/tap-start-to-run-workers.d.ts +8 -0
- package/lib/hooks/tap-start-to-run-workers.js +132 -0
- package/lib/hooks/tap-stop-to-terminate-workers.d.ts +5 -0
- package/lib/hooks/tap-stop-to-terminate-workers.js +26 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -0
- package/lib/infrastructure-logger.d.ts +9 -0
- package/lib/infrastructure-logger.js +14 -0
- package/lib/issue/index.d.ts +3 -0
- package/lib/issue/index.js +15 -0
- package/lib/issue/issue-config.d.ts +8 -0
- package/lib/issue/issue-config.js +29 -0
- package/lib/issue/issue-location.d.ts +8 -0
- package/lib/issue/issue-location.js +22 -0
- package/lib/issue/issue-match.d.ts +5 -0
- package/lib/issue/issue-match.js +20 -0
- package/lib/issue/issue-options.d.ts +8 -0
- package/lib/issue/issue-options.js +2 -0
- package/lib/issue/issue-position.d.ts +6 -0
- package/lib/issue/issue-position.js +16 -0
- package/lib/issue/issue-predicate.d.ts +5 -0
- package/lib/issue/issue-predicate.js +11 -0
- package/lib/issue/issue-severity.d.ts +4 -0
- package/lib/issue/issue-severity.js +12 -0
- package/lib/issue/issue-webpack-error.d.ts +10 -0
- package/lib/issue/issue-webpack-error.js +51 -0
- package/lib/issue/issue.d.ts +12 -0
- package/lib/issue/issue.js +41 -0
- package/lib/logger.d.ts +5 -0
- package/lib/logger.js +2 -0
- package/lib/plugin-config.d.ts +16 -0
- package/lib/plugin-config.js +26 -0
- package/lib/plugin-hooks.d.ts +20 -0
- package/lib/plugin-hooks.js +45 -0
- package/lib/plugin-options.d.ts +13 -0
- package/lib/plugin-options.js +2 -0
- package/lib/plugin-options.json +197 -0
- package/lib/plugin-pools.d.ts +4 -0
- package/lib/plugin-pools.js +28 -0
- package/lib/plugin-state.d.ts +18 -0
- package/lib/plugin-state.js +17 -0
- package/lib/plugin.d.ts +29 -0
- package/lib/plugin.js +79 -0
- package/lib/rpc/expose-rpc.d.ts +1 -0
- package/lib/rpc/expose-rpc.js +78 -0
- package/lib/rpc/index.d.ts +5 -0
- package/lib/rpc/index.js +12 -0
- package/lib/rpc/rpc-error.d.ts +6 -0
- package/lib/rpc/rpc-error.js +12 -0
- package/lib/rpc/rpc-worker.d.ts +13 -0
- package/lib/rpc/rpc-worker.js +79 -0
- package/lib/rpc/types.d.ts +19 -0
- package/lib/rpc/types.js +2 -0
- package/lib/rpc/wrap-rpc.d.ts +4 -0
- package/lib/rpc/wrap-rpc.js +79 -0
- package/lib/typescript/type-script-config-overwrite.d.ts +12 -0
- package/lib/typescript/type-script-config-overwrite.js +2 -0
- package/lib/typescript/type-script-diagnostics-options.d.ts +7 -0
- package/lib/typescript/type-script-diagnostics-options.js +2 -0
- package/lib/typescript/type-script-support.d.ts +3 -0
- package/lib/typescript/type-script-support.js +63 -0
- package/lib/typescript/type-script-worker-config.d.ts +18 -0
- package/lib/typescript/type-script-worker-config.js +18 -0
- package/lib/typescript/type-script-worker-options.d.ts +14 -0
- package/lib/typescript/type-script-worker-options.js +2 -0
- package/lib/typescript/worker/get-dependencies-worker.d.ts +5 -0
- package/lib/typescript/worker/get-dependencies-worker.js +15 -0
- package/lib/typescript/worker/get-issues-worker.d.ts +5 -0
- package/lib/typescript/worker/get-issues-worker.js +80 -0
- package/lib/typescript/worker/lib/artifacts.d.ts +4 -0
- package/lib/typescript/worker/lib/artifacts.js +90 -0
- package/lib/typescript/worker/lib/config.d.ts +15 -0
- package/lib/typescript/worker/lib/config.js +131 -0
- package/lib/typescript/worker/lib/dependencies.d.ts +3 -0
- package/lib/typescript/worker/lib/dependencies.js +81 -0
- package/lib/typescript/worker/lib/diagnostics.d.ts +7 -0
- package/lib/typescript/worker/lib/diagnostics.js +108 -0
- package/lib/typescript/worker/lib/emit.d.ts +2 -0
- package/lib/typescript/worker/lib/emit.js +13 -0
- package/lib/typescript/worker/lib/file-system/file-system.d.ts +18 -0
- package/lib/typescript/worker/lib/file-system/file-system.js +2 -0
- package/lib/typescript/worker/lib/file-system/mem-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/mem-file-system.js +78 -0
- package/lib/typescript/worker/lib/file-system/passive-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/passive-file-system.js +65 -0
- package/lib/typescript/worker/lib/file-system/real-file-system.d.ts +5 -0
- package/lib/typescript/worker/lib/file-system/real-file-system.js +187 -0
- package/lib/typescript/worker/lib/host/compiler-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/compiler-host.js +10 -0
- package/lib/typescript/worker/lib/host/watch-compiler-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/watch-compiler-host.js +20 -0
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.d.ts +2 -0
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +47 -0
- package/lib/typescript/worker/lib/performance.d.ts +3 -0
- package/lib/typescript/worker/lib/performance.js +32 -0
- package/lib/typescript/worker/lib/program/program.d.ts +2 -0
- package/lib/typescript/worker/lib/program/program.js +37 -0
- package/lib/typescript/worker/lib/program/solution-builder.d.ts +2 -0
- package/lib/typescript/worker/lib/program/solution-builder.js +39 -0
- package/lib/typescript/worker/lib/program/watch-program.d.ts +3 -0
- package/lib/typescript/worker/lib/program/watch-program.js +51 -0
- package/lib/typescript/worker/lib/system.d.ts +19 -0
- package/lib/typescript/worker/lib/system.js +232 -0
- package/lib/typescript/worker/lib/tracing.d.ts +4 -0
- package/lib/typescript/worker/lib/tracing.js +29 -0
- package/lib/typescript/worker/lib/tsbuildinfo.d.ts +4 -0
- package/lib/typescript/worker/lib/tsbuildinfo.js +92 -0
- package/lib/typescript/worker/lib/typescript.d.ts +2 -0
- package/lib/typescript/worker/lib/typescript.js +6 -0
- package/lib/typescript/worker/lib/worker-config.d.ts +2 -0
- package/lib/typescript/worker/lib/worker-config.js +5 -0
- package/lib/utils/async/abort-error.d.ts +6 -0
- package/lib/utils/async/abort-error.js +15 -0
- package/lib/utils/async/controlled-promise.d.ts +6 -0
- package/lib/utils/async/controlled-promise.js +17 -0
- package/lib/utils/async/is-pending.d.ts +2 -0
- package/lib/utils/async/is-pending.js +10 -0
- package/lib/utils/async/pool.d.ts +10 -0
- package/lib/utils/async/pool.js +47 -0
- package/lib/utils/async/wait.d.ts +2 -0
- package/lib/utils/async/wait.js +7 -0
- package/lib/utils/path/forward-slash.d.ts +6 -0
- package/lib/utils/path/forward-slash.js +15 -0
- package/lib/utils/path/is-inside-another-path.d.ts +2 -0
- package/lib/utils/path/is-inside-another-path.js +22 -0
- package/lib/utils/path/relative-to-context.d.ts +2 -0
- package/lib/utils/path/relative-to-context.js +16 -0
- package/lib/watch/inclusive-node-watch-file-system.d.ts +15 -0
- package/lib/watch/inclusive-node-watch-file-system.js +166 -0
- package/lib/watch/watch-file-system.d.ts +16 -0
- package/lib/watch/watch-file-system.js +2 -0
- package/package.json +88 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 TypeStrong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# TS Checker Rspack Plugin
|
|
2
|
+
|
|
3
|
+
Rspack plugin that runs TypeScript type checker on a separate process.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/ts-checker-rspack-plugin)
|
|
6
|
+
[](https://npmjs.org/package/ts-checker-rspack-plugin)
|
|
7
|
+
|
|
8
|
+
## Credits
|
|
9
|
+
|
|
10
|
+
This plugin is forked from [TypeStrong/fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin), which is created by [Piotr Oleś](https://github.com/piotr-oles). See the original project's [LICENSE](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/LICENSE).
|
|
11
|
+
|
|
12
|
+
Big thanks to `fork-ts-checker-webpack-plugin` creators and contributors for their great work. ❤️
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- Speeds up [TypeScript](https://github.com/Microsoft/TypeScript) type checking (by moving it to a separate process) 🏎
|
|
17
|
+
- Supports modern TypeScript features like [project references](https://www.typescriptlang.org/docs/handbook/project-references.html) and [incremental mode](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#faster-subsequent-builds-with-the---incremental-flag) ✨
|
|
18
|
+
- Displays nice error messages with the [code frame](https://babeljs.io/docs/en/next/babel-code-frame.html) formatter 🌈
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
This plugin requires **Node.js >=14.0.0+**, **Rspack ^1.0.0**, **TypeScript ^3.6.0**
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
# with npm
|
|
26
|
+
npm install -D ts-checker-rspack-plugin
|
|
27
|
+
|
|
28
|
+
# with yarn
|
|
29
|
+
yarn add -D ts-checker-rspack-plugin
|
|
30
|
+
|
|
31
|
+
# with pnpm
|
|
32
|
+
pnpm add -D ts-checker-rspack-plugin
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The minimal webpack config (with [ts-loader](https://github.com/TypeStrong/ts-loader))
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
// rspack.config.js
|
|
39
|
+
const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
context: __dirname, // to automatically find tsconfig.json
|
|
43
|
+
entry: './src/index.ts',
|
|
44
|
+
resolve: {
|
|
45
|
+
extensions: ['.ts', '.tsx', '.js'],
|
|
46
|
+
},
|
|
47
|
+
module: {
|
|
48
|
+
rules: [
|
|
49
|
+
{
|
|
50
|
+
test: /\.tsx?$/,
|
|
51
|
+
loader: 'ts-loader',
|
|
52
|
+
// add transpileOnly option if you use ts-loader < 9.3.0
|
|
53
|
+
// options: {
|
|
54
|
+
// transpileOnly: true
|
|
55
|
+
// }
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
plugins: [new TsCheckerRspackPlugin()],
|
|
60
|
+
watchOptions: {
|
|
61
|
+
// for some systems, watching many files can result in a lot of CPU or memory usage
|
|
62
|
+
// https://rspack.dev/config/watch#watchoptionsignored
|
|
63
|
+
// don't use this pattern, if you have a monorepo with linked packages
|
|
64
|
+
ignored: /node_modules/,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> Examples how to configure it with [babel-loader](https://github.com/babel/babel-loader), [ts-loader](https://github.com/TypeStrong/ts-loader)
|
|
70
|
+
> and [Visual Studio Code](https://code.visualstudio.com/) are in the [**examples**](./examples) directory.
|
|
71
|
+
|
|
72
|
+
## Modules resolution
|
|
73
|
+
|
|
74
|
+
It's very important to be aware that **this plugin uses [TypeScript](https://github.com/Microsoft/TypeScript)'s, not
|
|
75
|
+
Rspack's modules resolution**. It means that you have to setup `tsconfig.json` correctly.
|
|
76
|
+
|
|
77
|
+
> It's because of the performance - with TypeScript's module resolution we don't have to wait for Rspack to compile files.
|
|
78
|
+
>
|
|
79
|
+
> To debug TypeScript's modules resolution, you can use `tsc --traceResolution` command.
|
|
80
|
+
|
|
81
|
+
## Options
|
|
82
|
+
|
|
83
|
+
| Name | Type | Default value | Description |
|
|
84
|
+
| ------------ | ---------------------------------------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `async` | `boolean` | `compiler.options.mode === 'development'` | If `true`, reports issues **after** Rspack's compilation is done. Thanks to that it doesn't block the compilation. Used only in the `watch` mode. |
|
|
86
|
+
| `typescript` | `object` | `{}` | See [TypeScript options](#typescript-options). |
|
|
87
|
+
| `issue` | `object` | `{}` | See [Issues options](#issues-options). |
|
|
88
|
+
| `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' }`. |
|
|
89
|
+
| `logger` | `{ log: function, error: function }` or `webpack-infrastructure` | `console` | Console-like object to print issues in `async` mode. |
|
|
90
|
+
| `devServer` | `boolean` | `true` | If set to `false`, errors will not be reported to Dev Server. |
|
|
91
|
+
|
|
92
|
+
### TypeScript options
|
|
93
|
+
|
|
94
|
+
Options for the TypeScript checker (`typescript` option object).
|
|
95
|
+
|
|
96
|
+
| Name | Type | Default value | Description |
|
|
97
|
+
| ------------------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
98
|
+
| `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. |
|
|
99
|
+
| `configFile` | `string` | `'tsconfig.json'` | Path to the `tsconfig.json` file (path relative to the `compiler.options.context` or absolute path) |
|
|
100
|
+
| `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`. |
|
|
101
|
+
| `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 `ts-checker-rspack-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`. |
|
|
102
|
+
| `build` | `boolean` | `false` | The equivalent of the `--build` flag for the `tsc` command. |
|
|
103
|
+
| `mode` | `'readonly'` or `'write-dts'` or `'write-tsbuildinfo'` or `'write-references'` | `build === true ? 'write-tsbuildinfo' ? 'readonly'` | Use `readonly` if you don't want to write anything on the disk, `write-dts` to write only `.d.ts` files, `write-tsbuildinfo` to write only `.tsbuildinfo` files, `write-references` to write both `.js` and `.d.ts` files of project references (last 2 modes requires `build: true`). |
|
|
104
|
+
| `diagnosticOptions` | `object` | `{ syntactic: false, semantic: true, declaration: false, global: false }` | Settings to select which diagnostics do we want to perform. |
|
|
105
|
+
| `profile` | `boolean` | `false` | Measures and prints timings related to the TypeScript performance. |
|
|
106
|
+
| `typescriptPath` | `string` | `require.resolve('typescript')` | If supplied this is a custom path where TypeScript can be found. |
|
|
107
|
+
|
|
108
|
+
### Issues options
|
|
109
|
+
|
|
110
|
+
Options for the issues filtering (`issue` option object).
|
|
111
|
+
I could write some plain text explanation of these options but I think code will explain it better:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
interface Issue {
|
|
115
|
+
severity: 'error' | 'warning';
|
|
116
|
+
code: string;
|
|
117
|
+
file?: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
type IssueMatch = Partial<Issue>; // file field supports glob matching
|
|
121
|
+
type IssuePredicate = (issue: Issue) => boolean;
|
|
122
|
+
type IssueFilter = IssueMatch | IssuePredicate | (IssueMatch | IssuePredicate)[];
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
| Name | Type | Default value | Description |
|
|
126
|
+
| --------- | ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
127
|
+
| `include` | `IssueFilter` | `undefined` | If `object`, defines issue properties that should be [matched](src/issue/issue-match.ts). If `function`, acts as a predicate where `issue` is an argument. |
|
|
128
|
+
| `exclude` | `IssueFilter` | `undefined` | Same as `include` but issues that match this predicate will be excluded. |
|
|
129
|
+
|
|
130
|
+
<details>
|
|
131
|
+
<summary>Expand example</summary>
|
|
132
|
+
|
|
133
|
+
Include issues from the `src` directory, exclude issues from `.spec.ts` files:
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
module.exports = {
|
|
137
|
+
// ...the Rspack configuration
|
|
138
|
+
plugins: [
|
|
139
|
+
new TsCheckerRspackPlugin({
|
|
140
|
+
issue: {
|
|
141
|
+
include: [{ file: '**/src/**/*' }],
|
|
142
|
+
exclude: [{ file: '**/*.spec.ts' }],
|
|
143
|
+
},
|
|
144
|
+
}),
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
</details>
|
|
150
|
+
|
|
151
|
+
## Plugin hooks
|
|
152
|
+
|
|
153
|
+
This plugin provides some custom Rspack hooks:
|
|
154
|
+
|
|
155
|
+
| Hook key | Type | Params | Description |
|
|
156
|
+
| ---------- | -------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
157
|
+
| `start` | `AsyncSeriesWaterfallHook` | `change, compilation` | Starts issues checking for a compilation. It's an async waterfall hook, so you can modify the list of changed and removed files or delay the start of the service. |
|
|
158
|
+
| `waiting` | `SyncHook` | `compilation` | Waiting for the issues checking. |
|
|
159
|
+
| `canceled` | `SyncHook` | `compilation` | Issues checking for the compilation has been canceled. |
|
|
160
|
+
| `error` | `SyncHook` | `compilation` | An error occurred during issues checking. |
|
|
161
|
+
| `issues` | `SyncWaterfallHook` | `issues, compilation` | Issues have been received and will be reported. It's a waterfall hook, so you can modify the list of received issues. |
|
|
162
|
+
|
|
163
|
+
To access plugin hooks and tap into the event, we need to use the `getCompilerHooks` static method.
|
|
164
|
+
When we call this method with a [Rspack compiler instance](https://rspack.dev/api/javascript-api/compiler), it returns the object with
|
|
165
|
+
[tapable](https://github.com/webpack/tapable) hooks where you can pass in your callbacks.
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
// ./src/webpack/MyWebpackPlugin.js
|
|
169
|
+
const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
|
|
170
|
+
|
|
171
|
+
class MyWebpackPlugin {
|
|
172
|
+
apply(compiler) {
|
|
173
|
+
const hooks = TsCheckerRspackPlugin.getCompilerHooks(compiler);
|
|
174
|
+
|
|
175
|
+
// log some message on waiting
|
|
176
|
+
hooks.waiting.tap('MyPlugin', () => {
|
|
177
|
+
console.log('waiting for issues');
|
|
178
|
+
});
|
|
179
|
+
// don't show warnings
|
|
180
|
+
hooks.issues.tap('MyPlugin', (issues) => issues.filter((issue) => issue.severity === 'error'));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
module.exports = MyWebpackPlugin;
|
|
185
|
+
|
|
186
|
+
// rspack.config.js
|
|
187
|
+
const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
|
|
188
|
+
const MyWebpackPlugin = require('./src/webpack/MyWebpackPlugin');
|
|
189
|
+
|
|
190
|
+
module.exports = {
|
|
191
|
+
/* ... */
|
|
192
|
+
plugins: [new TsCheckerRspackPlugin(), new MyWebpackPlugin()],
|
|
193
|
+
};
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Profiling types resolution
|
|
197
|
+
|
|
198
|
+
When using TypeScript 4.3.0 or newer you can profile long type checks by
|
|
199
|
+
setting "generateTrace" compiler option. This is an instruction from [microsoft/TypeScript#40063](https://github.com/microsoft/TypeScript/pull/40063):
|
|
200
|
+
|
|
201
|
+
1. Set "generateTrace": "{folderName}" in your `tsconfig.json` (under `compilerOptions`)
|
|
202
|
+
2. Look in the resulting folder. If you used build mode, there will be a `legend.json` telling you what went where.
|
|
203
|
+
Otherwise, there will be `trace.json` file and `types.json` files.
|
|
204
|
+
3. Navigate to [edge://tracing](edge://tracing) or [chrome://tracing](chrome://tracing) and load `trace.json`
|
|
205
|
+
4. Expand Process 1 with the little triangle in the left sidebar
|
|
206
|
+
5. Click on different blocks to see their payloads in the bottom pane
|
|
207
|
+
6. Open `types.json` in an editor
|
|
208
|
+
7. When you see a type ID in the tracing output, go-to-line {id} to find data about that type
|
|
209
|
+
|
|
210
|
+
## Enabling incremental mode
|
|
211
|
+
|
|
212
|
+
You must both set "incremental": true in your `tsconfig.json` (under `compilerOptions`) and also specify mode: 'write-references' in `TsCheckerRspackPlugin` settings.
|
|
213
|
+
|
|
214
|
+
## License
|
|
215
|
+
|
|
216
|
+
MIT License
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as rspack from '@rspack/core';
|
|
2
|
+
interface FilesChange {
|
|
3
|
+
changedFiles?: string[];
|
|
4
|
+
deletedFiles?: string[];
|
|
5
|
+
}
|
|
6
|
+
declare function getFilesChange(compiler: rspack.Compiler): FilesChange;
|
|
7
|
+
declare function consumeFilesChange(compiler: rspack.Compiler): FilesChange;
|
|
8
|
+
declare function updateFilesChange(compiler: rspack.Compiler, change: FilesChange): void;
|
|
9
|
+
declare function clearFilesChange(compiler: rspack.Compiler): void;
|
|
10
|
+
/**
|
|
11
|
+
* Computes aggregated files change based on the subsequent files changes.
|
|
12
|
+
*
|
|
13
|
+
* @param changes List of subsequent files changes
|
|
14
|
+
* @returns Files change that represents all subsequent changes as a one event
|
|
15
|
+
*/
|
|
16
|
+
declare function aggregateFilesChanges(changes: FilesChange[]): FilesChange;
|
|
17
|
+
export { FilesChange, getFilesChange, consumeFilesChange, updateFilesChange, clearFilesChange, aggregateFilesChanges, };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aggregateFilesChanges = exports.clearFilesChange = exports.updateFilesChange = exports.consumeFilesChange = exports.getFilesChange = void 0;
|
|
4
|
+
// we ignore package.json file because of https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/674
|
|
5
|
+
const IGNORED_FILES = ['package.json'];
|
|
6
|
+
const isIgnoredFile = (file) => IGNORED_FILES.some((ignoredFile) => file.endsWith(`/${ignoredFile}`) || file.endsWith(`\\${ignoredFile}`));
|
|
7
|
+
const compilerFilesChangeMap = new WeakMap();
|
|
8
|
+
function getFilesChange(compiler) {
|
|
9
|
+
const { changedFiles = [], deletedFiles = [] } = compilerFilesChangeMap.get(compiler) || {
|
|
10
|
+
changedFiles: [],
|
|
11
|
+
deletedFiles: [],
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
changedFiles: changedFiles.filter((changedFile) => !isIgnoredFile(changedFile)),
|
|
15
|
+
deletedFiles: deletedFiles.filter((deletedFile) => !isIgnoredFile(deletedFile)),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.getFilesChange = getFilesChange;
|
|
19
|
+
function consumeFilesChange(compiler) {
|
|
20
|
+
const change = getFilesChange(compiler);
|
|
21
|
+
clearFilesChange(compiler);
|
|
22
|
+
return change;
|
|
23
|
+
}
|
|
24
|
+
exports.consumeFilesChange = consumeFilesChange;
|
|
25
|
+
function updateFilesChange(compiler, change) {
|
|
26
|
+
compilerFilesChangeMap.set(compiler, aggregateFilesChanges([getFilesChange(compiler), change]));
|
|
27
|
+
}
|
|
28
|
+
exports.updateFilesChange = updateFilesChange;
|
|
29
|
+
function clearFilesChange(compiler) {
|
|
30
|
+
compilerFilesChangeMap.delete(compiler);
|
|
31
|
+
}
|
|
32
|
+
exports.clearFilesChange = clearFilesChange;
|
|
33
|
+
/**
|
|
34
|
+
* Computes aggregated files change based on the subsequent files changes.
|
|
35
|
+
*
|
|
36
|
+
* @param changes List of subsequent files changes
|
|
37
|
+
* @returns Files change that represents all subsequent changes as a one event
|
|
38
|
+
*/
|
|
39
|
+
function aggregateFilesChanges(changes) {
|
|
40
|
+
const changedFilesSet = new Set();
|
|
41
|
+
const deletedFilesSet = new Set();
|
|
42
|
+
for (const { changedFiles = [], deletedFiles = [] } of changes) {
|
|
43
|
+
for (const changedFile of changedFiles) {
|
|
44
|
+
changedFilesSet.add(changedFile);
|
|
45
|
+
deletedFilesSet.delete(changedFile);
|
|
46
|
+
}
|
|
47
|
+
for (const deletedFile of deletedFiles) {
|
|
48
|
+
changedFilesSet.delete(deletedFile);
|
|
49
|
+
deletedFilesSet.add(deletedFile);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
changedFiles: Array.from(changedFilesSet),
|
|
54
|
+
deletedFiles: Array.from(deletedFilesSet),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.aggregateFilesChanges = aggregateFilesChanges;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createBasicFormatter = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
function createBasicFormatter() {
|
|
9
|
+
return function basicFormatter(issue) {
|
|
10
|
+
return chalk_1.default.grey(issue.code + ': ') + issue.message;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.createBasicFormatter = createBasicFormatter;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createCodeFrameFormatter = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const code_frame_1 = require("@babel/code-frame");
|
|
9
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const basic_formatter_1 = require("./basic-formatter");
|
|
11
|
+
function createCodeFrameFormatter(options) {
|
|
12
|
+
const basicFormatter = (0, basic_formatter_1.createBasicFormatter)();
|
|
13
|
+
return function codeFrameFormatter(issue) {
|
|
14
|
+
const source = issue.file && fs_extra_1.default.existsSync(issue.file) && fs_extra_1.default.readFileSync(issue.file, 'utf-8');
|
|
15
|
+
let frame = '';
|
|
16
|
+
if (source && issue.location) {
|
|
17
|
+
frame = (0, code_frame_1.codeFrameColumns)(source, issue.location, Object.assign({ highlightCode: true }, (options || {})))
|
|
18
|
+
.split('\n')
|
|
19
|
+
.map((line) => ' ' + line)
|
|
20
|
+
.join(os_1.default.EOL);
|
|
21
|
+
}
|
|
22
|
+
const lines = [basicFormatter(issue)];
|
|
23
|
+
if (frame) {
|
|
24
|
+
lines.push(frame);
|
|
25
|
+
}
|
|
26
|
+
return lines.join(os_1.default.EOL);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.createCodeFrameFormatter = createCodeFrameFormatter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Formatter, FormatterPathType } from './formatter';
|
|
2
|
+
import type { FormatterOptions } from './formatter-options';
|
|
3
|
+
declare type FormatterConfig = {
|
|
4
|
+
format: Formatter;
|
|
5
|
+
pathType: FormatterPathType;
|
|
6
|
+
};
|
|
7
|
+
declare function createFormatterConfig(options: FormatterOptions | undefined): FormatterConfig;
|
|
8
|
+
export { FormatterConfig, createFormatterConfig };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFormatterConfig = void 0;
|
|
4
|
+
const basic_formatter_1 = require("./basic-formatter");
|
|
5
|
+
const code_frame_formatter_1 = require("./code-frame-formatter");
|
|
6
|
+
function createFormatterConfig(options) {
|
|
7
|
+
if (typeof options === 'function') {
|
|
8
|
+
return {
|
|
9
|
+
format: options,
|
|
10
|
+
pathType: 'relative',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const type = options
|
|
14
|
+
? typeof options === 'object'
|
|
15
|
+
? options.type || 'codeframe'
|
|
16
|
+
: options
|
|
17
|
+
: 'codeframe';
|
|
18
|
+
const pathType = options && typeof options === 'object' ? options.pathType || 'relative' : 'relative';
|
|
19
|
+
if (!type || type === 'basic') {
|
|
20
|
+
return {
|
|
21
|
+
format: (0, basic_formatter_1.createBasicFormatter)(),
|
|
22
|
+
pathType,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (type === 'codeframe') {
|
|
26
|
+
const config = options && typeof options === 'object'
|
|
27
|
+
? options.options || {}
|
|
28
|
+
: {};
|
|
29
|
+
return {
|
|
30
|
+
format: (0, code_frame_formatter_1.createCodeFrameFormatter)(config),
|
|
31
|
+
pathType,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
throw new Error(`Unknown "${type}" formatter. Available types are: "basic", "codeframe" or a custom function.`);
|
|
35
|
+
}
|
|
36
|
+
exports.createFormatterConfig = createFormatterConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Formatter, FormatterPathType } from './formatter';
|
|
2
|
+
import type { BabelCodeFrameOptions } from './types/babel__code-frame';
|
|
3
|
+
declare type FormatterType = 'basic' | 'codeframe';
|
|
4
|
+
declare type BasicFormatterOptions = {
|
|
5
|
+
type: 'basic';
|
|
6
|
+
pathType?: FormatterPathType;
|
|
7
|
+
};
|
|
8
|
+
declare type CodeframeFormatterOptions = {
|
|
9
|
+
type: 'codeframe';
|
|
10
|
+
pathType?: FormatterPathType;
|
|
11
|
+
options?: BabelCodeFrameOptions;
|
|
12
|
+
};
|
|
13
|
+
declare type FormatterOptions = undefined | FormatterType | BasicFormatterOptions | CodeframeFormatterOptions | Formatter;
|
|
14
|
+
export { FormatterOptions, FormatterType, BasicFormatterOptions, CodeframeFormatterOptions };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./formatter"), exports);
|
|
14
|
+
__exportStar(require("./basic-formatter"), exports);
|
|
15
|
+
__exportStar(require("./code-frame-formatter"), exports);
|
|
16
|
+
__exportStar(require("./webpack-formatter"), exports);
|
|
17
|
+
__exportStar(require("./formatter-options"), exports);
|
|
18
|
+
__exportStar(require("./formatter-config"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.statsFormatter = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
// mimics webpack's stats summary formatter
|
|
9
|
+
function statsFormatter(issues, stats) {
|
|
10
|
+
const errorsNumber = issues.filter((issue) => issue.severity === 'error').length;
|
|
11
|
+
const warningsNumber = issues.filter((issue) => issue.severity === 'warning').length;
|
|
12
|
+
const errorsFormatted = errorsNumber
|
|
13
|
+
? chalk_1.default.red.bold(`${errorsNumber} ${errorsNumber === 1 ? 'error' : 'errors'}`)
|
|
14
|
+
: '';
|
|
15
|
+
const warningsFormatted = warningsNumber
|
|
16
|
+
? chalk_1.default.yellow.bold(`${warningsNumber} ${warningsNumber === 1 ? 'warning' : 'warnings'}`)
|
|
17
|
+
: '';
|
|
18
|
+
const timeFormatted = stats.startTime ? Math.round(Date.now() - stats.startTime) : 0;
|
|
19
|
+
return [
|
|
20
|
+
'Found ',
|
|
21
|
+
errorsFormatted,
|
|
22
|
+
errorsFormatted && warningsFormatted ? ' and ' : '',
|
|
23
|
+
warningsFormatted,
|
|
24
|
+
timeFormatted ? ` in ${timeFormatted} ms` : '',
|
|
25
|
+
'.',
|
|
26
|
+
].join('');
|
|
27
|
+
}
|
|
28
|
+
exports.statsFormatter = statsFormatter;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface BabelCodeFrameOptions {
|
|
2
|
+
/** Syntax highlight the code as JavaScript for terminals. default: false */
|
|
3
|
+
highlightCode?: boolean;
|
|
4
|
+
/** The number of lines to show above the error. default: 2 */
|
|
5
|
+
linesAbove?: number;
|
|
6
|
+
/** The number of lines to show below the error. default: 3 */
|
|
7
|
+
linesBelow?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Forcibly syntax highlight the code as JavaScript (for non-terminals);
|
|
10
|
+
* overrides highlightCode.
|
|
11
|
+
* default: false
|
|
12
|
+
*/
|
|
13
|
+
forceColor?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Pass in a string to be displayed inline (if possible) next to the
|
|
16
|
+
* highlighted location in the code. If it can't be positioned inline,
|
|
17
|
+
* it will be placed above the code frame.
|
|
18
|
+
* default: nothing
|
|
19
|
+
*/
|
|
20
|
+
message?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Base on the type definitions for @babel/code-frame 7.0
|
|
3
|
+
// Project: https://github.com/babel/babel/tree/main/packages/babel-code-frame, https://babeljs.io
|
|
4
|
+
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>
|
|
5
|
+
// Forbes Lindesay <https://github.com/ForbesLindesay>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createWebpackFormatter = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const issue_1 = require("../issue");
|
|
11
|
+
const forward_slash_1 = require("../utils/path/forward-slash");
|
|
12
|
+
const relative_to_context_1 = require("../utils/path/relative-to-context");
|
|
13
|
+
function createWebpackFormatter(formatter, pathType) {
|
|
14
|
+
// mimics webpack error formatter
|
|
15
|
+
return function webpackFormatter(issue) {
|
|
16
|
+
const color = issue.severity === 'warning' ? chalk_1.default.yellow.bold : chalk_1.default.red.bold;
|
|
17
|
+
const severity = issue.severity.toUpperCase();
|
|
18
|
+
if (issue.file) {
|
|
19
|
+
let location = chalk_1.default.bold(pathType === 'absolute'
|
|
20
|
+
? (0, forward_slash_1.forwardSlash)(path_1.default.resolve(issue.file))
|
|
21
|
+
: (0, relative_to_context_1.relativeToContext)(issue.file, process.cwd()));
|
|
22
|
+
if (issue.location) {
|
|
23
|
+
location += `:${chalk_1.default.green.bold((0, issue_1.formatIssueLocation)(issue.location))}`;
|
|
24
|
+
}
|
|
25
|
+
return [`${color(severity)} in ${location}`, formatter(issue), ''].join(os_1.default.EOL);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return [`${color(severity)} in ` + formatter(issue), ''].join(os_1.default.EOL);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.createWebpackFormatter = createWebpackFormatter;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as rspack from '@rspack/core';
|
|
2
|
+
import type { TsCheckerRspackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { TsCheckerRspackPluginState } from '../plugin-state';
|
|
4
|
+
declare function interceptDoneToGetDevServerTap(compiler: rspack.Compiler, config: TsCheckerRspackPluginConfig, state: TsCheckerRspackPluginState): void;
|
|
5
|
+
export { interceptDoneToGetDevServerTap };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interceptDoneToGetDevServerTap = void 0;
|
|
4
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
5
|
+
function interceptDoneToGetDevServerTap(compiler, config, state) {
|
|
6
|
+
const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
|
|
7
|
+
// inspired by https://github.com/ypresto/fork-ts-checker-async-overlay-webpack-plugin
|
|
8
|
+
compiler.hooks.done.intercept({
|
|
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;
|
|
13
|
+
}
|
|
14
|
+
return tap;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.interceptDoneToGetDevServerTap = interceptDoneToGetDevServerTap;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as rspack from '@rspack/core';
|
|
2
|
+
import type { TsCheckerRspackPluginConfig } from '../plugin-config';
|
|
3
|
+
import type { TsCheckerRspackPluginState } from '../plugin-state';
|
|
4
|
+
declare function tapAfterCompileToAddDependencies(compiler: rspack.Compiler, config: TsCheckerRspackPluginConfig, state: TsCheckerRspackPluginState): void;
|
|
5
|
+
export { tapAfterCompileToAddDependencies };
|