diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1cd255..4e91535 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,3 +19,30 @@ Create a `.env.local` to set the default minimum width/height (in pixels) for a VITE_DEFAULT_SASH_MIN_WIDTH=100 VITE_DEFAULT_SASH_MIN_HEIGHT=100 ``` + +## Working with react-bwin + +[`react-bwin`](https://github.com/bhjsdev/react-bwin) consumes bwin's **built** +output (`dist/bwin.js`), not `src/`. To develop both together (assuming the +repos are siblings), link them and rebuild bwin on save: + +In `react-bwin`, symlink to your local bwin checkout (don't commit this): + +```sh +pnpm add bwin@link:../bwin +``` + +In `bwin`, regenerate `dist/bwin.js` on every change: + +```sh +pnpm build:watch +``` + +In `react-bwin`, start the dev server (hot-reloads through the symlink): + +```sh +pnpm dev +``` + +`pnpm dev` still works in bwin alongside `build:watch` if you want bwin's own +dev pages running at the same time. diff --git a/package.json b/package.json index 528d6d5..0c6286c 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "scripts": { "dev": "vite --port 7100", "build": "vite build", + "build:watch": "vite build --watch", "test": "vitest", "format": "prettier --write .", "format:check": "prettier --check .",