Skip to content

Commit 1d3583b

Browse files
committed
docs: improve form and explanations
1 parent 9585daa commit 1d3583b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ vite-plugin-typescript-transform
1212
[badge-workflow-ci]: https://img.shields.io/github/actions/workflow/status/herberttn/vite-plugin-typescript-transform/ci.yml?branch=main&label=ci&logo=github&style=flat-square
1313
[badge-workflow-ci-link]: https://github.com/herberttn/vite-plugin-typescript-transform/actions/workflows/ci.yml
1414

15-
Applies the typescript compiler during vite transform build phase.
15+
Applies the TypeScript compiler during Vite transform build phase.
16+
17+
This plugin may allow the use of language features not yet supported by [`vite's`][link-to-vite] default compiler, [`esbuild`][link-to-esbuild].
1618

1719
[link-to-ecmascript-decorators]: https://tc39.es/proposal-decorators
1820
[link-to-esbuild]: https://www.npmjs.com/package/esbuild
@@ -28,13 +30,13 @@ npm install --save-dev vite-plugin-typescript-transform
2830
```
2931

3032
### Options
31-
See the [`Options`][link-to-options] interface.
33+
See the [`Options`][link-to-options] interface and its inline documentation.
3234

33-
### Transform ECMAScript decorators
34-
As of now, [`vite`][link-to-vite] uses [`esbuild`][link-to-esbuild] to transpile typescript, which doesn't yet support the new [ECMAScript decorators][link-to-ecmascript-decorators].
35-
But [`typescript`][link-to-typescript] added support for them in [`v5`][link-to-typescript-v5-announcement].
35+
### Warning
36+
This plugin does not change or disable any of [`vite's`][link-to-vite] compiler/features/options. It only transpiles the code using the [`typescript`][link-to-typescript] compiler and lets [`vite`][link-to-vite] move on with the transpiled code.
3637

37-
This example down-levels the new ECMAScript decorators into code that is usable in runtimes that do not yet support it.
38+
### Transform ECMAScript decorators
39+
The new [ECMAScript decorators][link-to-ecmascript-decorators] are not supported by [`esbuild`][link-to-esbuild] (yet), but they thy are supported by [`typescript`][link-to-typescript] since `v5` ([see the announcement][link-to-typescript-v5-announcement]). This example down-levels the new decorators into code that is usable in runtimes that do not yet support it.
3840
```typescript
3941
import ts from 'typescript';
4042
import { defineConfig } from 'vite';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-typescript-transform",
3-
"description": "Applies the typescript compiler during vite transform build phase.",
3+
"description": "Applies the TypeScript compiler during Vite transform build phase.",
44
"version": "1.2.0",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)