You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-17Lines changed: 8 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,28 +226,19 @@ For example, properly configuring the `include` and `exclude` scopes in `tsconfi
226
226
227
227
## Vue Components
228
228
229
-
`ts-checker-rspack-plugin` does not support checking TypeScript code in `.vue` components. You can check for type issues in `.vue` files in the following ways:
229
+
To enable typecheck in `.vue` files, use the custom TypeScript wrapper [`@esctn/vue-tsc-api`](https://www.npmjs.com/package/@esctn/vue-tsc-api). It works on top of [`vue-tsc`](https://www.npmjs.com/package/vue-tsc) — a popular CLI tool for type-checking Vue 3 code.
230
230
231
-
1. Install the [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) package, which provides the ability to check types in `.vue` files.
232
-
233
-
<PackageManagerTabscommand="add vue-tsc -D" />
234
-
235
-
2. Add the `vue-tsc --noEmit` command to the `build` script in package.json:
236
-
237
-
```diff title="package.json"
238
-
{
239
-
"scripts": {
240
-
- "build": "rsbuild build"
241
-
+ "build": "vue-tsc --noEmit && rsbuild build"
242
-
}
243
-
}
231
+
```bash
232
+
npm add @esctn/vue-tsc-api -D
244
233
```
245
234
246
-
3. Since the production build uses `vue-tsc` for type checking, you can disable the Type Check plugin in production mode to avoid redundant checks.
0 commit comments