From 61d076ae0ce724ffc5242358d067f7b1438d24bb Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 12 Dec 2021 11:45:30 -0800 Subject: [PATCH] docs: improve instructions for testing local changes against other packages (#6084) --- CONTRIBUTING.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 54ac9f4d4ddc81..fe17b0f3befe36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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