Skip to content

Commit

Permalink
docs: update defineConfig usage
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 16, 2022
1 parent ce418c5 commit 1f9d5bc
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 32 deletions.
9 changes: 4 additions & 5 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
To configure `vitest` itself, add `test` property in your Vite config. You'll also need to add a reference to Vitest types using a [triple slash command](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-) at the top of your config file.

```ts
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import { defineConfig } from 'vitest/node'

export default defineConfig({
test: {
Expand Down Expand Up @@ -78,7 +77,7 @@ By default, `vitest` does not provide global APIs for explicitness. If you prefe

```ts
// vite.config.ts
import { defineConfig } from 'vite'
import { defineConfig } from 'vitest/node'

export default defineConfig({
test: {
Expand All @@ -102,7 +101,7 @@ If you are already using [`unplugin-auto-import`](https://github.com/antfu/unplu

```ts
// vite.config.ts
import { defineConfig } from 'vite'
import { defineConfig } from 'vitest/node'
import AutoImport from 'unplugin-auto-import/vite'

export default defineConfig({
Expand Down Expand Up @@ -349,7 +348,7 @@ Vite plugins will receive `ssr: false` flag when processing those files.
When you use JSX as component models other than React (e.g. Vue JSX or SolidJS), you might want to config as following to make `.tsx` / `.jsx` transformed as client-side components:

```ts
import { defineConfig } from 'vite'
import { defineConfig } from 'vitest/node'

export default defineConfig({
test: {
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ After that, change the `environment` option in your config file:

```ts
// vite.config.ts
import { defineConfig } from 'vite'
import { defineConfig } from 'vitest/node'

export default defineConfig({
test: {
Expand All @@ -238,7 +238,7 @@ To configure it, set `test.coverage` options in your config file:

```ts
// vite.config.ts
import { defineConfig } from 'vite'
import { defineConfig } from 'vitest/node'

export default defineConfig({
test: {
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To configure `vitest` itself, add `test` property in your Vite config. You'll al

```ts
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import { defineConfig } from 'vitest/node'

export default defineConfig({
test: {
Expand Down
159 changes: 135 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f9d5bc

Please sign in to comment.