Skip to content

Commit

Permalink
docs: improve instructions for testing local changes against other pa…
Browse files Browse the repository at this point in the history
…ckages (#6084)
  • Loading branch information
benmccann authored Dec 12, 2021
1 parent 9c2843c commit 61d076a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ To develop and test the core `vite` package:

2. Go to `packages/vite` and run `pnpm run dev`. This starts `rollup` in watch mode.

3. Run `pnpm link --global` in `packages/vite`. This links `vite` globally so that you can:

- Run `pnpm link --global vite` in another Vite project to use the locally built Vite;
- Use the `vite` binary anywhere.

If your project has `vite` as a nested dependency, you can customize the dependency resolution instead depending on the package manager used. For pnpm, add this in your project's root `package.json`:

```json
{
"pnpm": {
"overrides": {
"vite": "link:../path/to/vite/packages/vite"
}
}
}
```
## Testing Vite against external packages

You may wish to test your locally-modified copy of Vite against another package that is built with Vite. For pnpm, after building Vite, you can use [`pnpm.overrides`](https://pnpm.io/package_json#pnpmoverrides). Please note that `pnpm.overrides` must be specified in the root `package.json` and you must first list the package as a dependency in the root `package.json`:

```json
{
"dependencies": {
"vite": "^2.0.0"
},
"pnpm": {
"overrides": {
"vite": "link:../path/to/vite/packages/vite"
}
}
}
```

And re-run `pnpm install` to link the package.
And re-run `pnpm install` to link the package.

## Running Tests

Expand Down

0 comments on commit 61d076a

Please sign in to comment.