Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/config/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { defineConfig } from 'vite-plus';

export default defineConfig({
run: {
enablePrePostScripts: true,
cache: {
/* ... */
},
Expand All @@ -17,6 +18,27 @@ export default defineConfig({
});
```

## `run.enablePrePostScripts`

- **Type:** `boolean`
- **Default:** `true`

Whether to automatically run `preX`/`postX` package.json scripts as lifecycle hooks when script `X` is executed.

When enabled (the default), running a script like `test` will automatically run `pretest` before it and `posttest` after it, if they exist in `package.json`.

```ts
export default defineConfig({
run: {
enablePrePostScripts: false, // Disable pre/post lifecycle hooks
},
});
```

::: warning
This option can only be set in the workspace root's `vite.config.ts`. Setting it in a package's config will result in an error.
:::

## `run.cache`

- **Type:** `boolean | { scripts?: boolean, tasks?: boolean }`
Expand Down
Loading