Skip to content

Commit b1ab56b

Browse files
authored
docs: update Readme for Vue support (#29)
1 parent 808b336 commit b1ab56b

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -226,28 +226,19 @@ For example, properly configuring the `include` and `exclude` scopes in `tsconfi
226226

227227
## Vue Components
228228

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.
230230

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-
<PackageManagerTabs command="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
244233
```
245234

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.
247-
248235
```js
249236
pluginTypeCheck({
250-
enable: process.env.NODE_ENV === "development",
237+
tsCheckerOptions: {
238+
typescript: {
239+
typescriptPath: '@esctn/vue-tsc-api'
240+
}
241+
},
251242
});
252243
```
253244

0 commit comments

Comments
 (0)