Skip to content

Commit 1471e64

Browse files
committed
docs: fix options and imports
1 parent 5c9b60a commit 1471e64

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,25 @@ See the [`Options`][link-to-options] interface.
3434
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].
3535
But [`typescript`][link-to-typescript] added support for them in [`v5`][link-to-typescript-v5-announcement].
3636

37-
This example transpiles the new ECMAScript decorators into code that is usable in runtimes that do not yet support it.
37+
This example down-levels the new ECMAScript decorators into code that is usable in runtimes that do not yet support it.
3838
```typescript
39+
import ts from 'typescript';
40+
import { defineConfig } from 'vite';
3941
import { vitePluginTypescriptTransform } from 'vite-plugin-typescript-transform';
40-
import { defineConfig } from 'vitest/config';
4142

4243
export default defineConfig({
4344
// ...your vite configuration
4445
plugins: [
4546
vitePluginTypescriptTransform({
46-
enfore: 'pre',
47+
enforce: 'pre',
4748
filter: {
4849
files: {
4950
include: /\.ts$/,
5051
},
5152
},
5253
tsconfig: {
5354
override: {
54-
target: 'ES2021',
55+
target: ts.ScriptTarget.ES2021,
5556
},
5657
},
5758
}),

0 commit comments

Comments
 (0)