https://github.com/aitoroses/rescript-monorepo
https://github.com/aitoroses/rescript-monorepo
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aitoroses/rescript-monorepo
- Owner: aitoroses
- Created: 2021-12-03T12:25:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-03T12:38:40.000Z (over 4 years ago)
- Last Synced: 2025-07-04T14:17:46.161Z (12 months ago)
- Language: ReScript
- Size: 136 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## To use
- `yarn`
- `yarn build`
- `yarn watch` (requires watchexec)
- open `index.html` (no server required)
# My ideal ReScript monorepo
The goal is to run a single `bsb` from the project root and have everything Just Work (tm).
This repository leverages ReScript pinned packages support. The setup:
- yarn workspace-based monorepo (this ensures there are no secondary `node_modules` folders in the packages which might confuse `bsb`)
- packages are listed under `bs-dependencies` and `pinned-dependencies`, which works because the yarn workspace creates symlinks to each source package in `node_modules`
- `yarn build` compiles and bundles
As of 8.4.2-dev.1 this is considered ready for use. However do note that interface modifications, no matter how small, will still trigger a forest of rebuilds. For example changing `ExampleStyles.re` in `b` is a contained rebuild as expected, but changing `ExampleStyles.rei` causes a complete rebuild of package `c` even though `c` only uses the `Examples` module from `b`, not `ExampleStyles`.
In a perfect scenario `bsb` would track dependencies at a more granular level, to rebuild based on interface contents rather than simple file timestamps, as it does when the same structure is modelled as a flat namespace with a single `bsconfig.json`.
### Source
Heavily modified from the ReasonReact Template.