Skip to content

Commit

Permalink
chore: add build --watch documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha committed Apr 2, 2021
1 parent 52a7404 commit fad6832
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,13 @@ export default async ({ command, mode }) => {
- **Default:** `500`

Limit for chunk size warnings (in kbs).

### build.watch

- **Type:** [`WatcherOptions`](https://rollupjs.org/guide/en/#watch-options)`| null`
- **Default:** `null`

Set to `{}` to enable rollup watcher. This is mostly used in cases that involve build-only plugins or integrations processes.

## Dep Optimization Options

Expand Down
15 changes: 15 additions & 0 deletions docs/guide/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ module.exports = {

For example, you can specify multiple Rollup outputs with plugins that are only applied during build.

## Rebuild on files changes

You can enable rollup watcher with `vite build --watch`. Or, you can directly adjust the underlying [`WatcherOptions`](https://rollupjs.org/guide/en/#watch-options) via `build.watch`:

```js
// vite.config.js
module.exports = {
build: {
watch: {
// https://rollupjs.org/guide/en/#watch-options
}
}
}
```

## Multi-Page App

Suppose you have the following source code structure:
Expand Down

0 comments on commit fad6832

Please sign in to comment.