You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/docs/manual/latest/build-configuration.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ Note that only sources marked with `"type":"dev"` will be able to resolve module
84
84
85
85
**Since 8.4**: List of pinned dependencies. A pinned dependency will always be rebuilt whenever you build a toplevel package (e.g. your main app) with `bsb -make-world`.
86
86
87
-
This is useful for working on multiple independent ReScript packages simultaneously. More usage details can be found in our [monorepo setup](./build-monorepos) page.
87
+
This is useful for working on multiple independent ReScript packages simultaneously. More usage details can be found in our dedicated [pinned dependencies](./build-pinned-dependencies) page.
We usually recommend using ReScript in a single-codebase style, where there is only one `bsconfig.json` file for the whole codebase. Many JavaScript libraries maintain multiple packages in one single codebase though, and use `yarn workspaces` to cross-link packages locally for development.
12
+
Usually we'd recommend to use ReScript in a single-codebase style: One `bsconfig.json` file for the whole codebase.
13
13
14
-
This workflow is not straightforward for ReScript usage, so we need to explain some additional concepts to make this work. There are three different kinds of packages:
14
+
There are scenarios where you still want to connect and build multiple independent ReScript packages for one main project though. This is where `pinned-dependencies` come into play.
15
+
16
+
17
+
### Package Types
18
+
19
+
Before we go into detail, let's first explain all the different package types recognized by the build system:
15
20
16
21
- Toplevel (this is usually the final app you are building, which has dependencies to other packages)
17
22
- Pinned dependencies (these are your local packages that should always rebuild when you build your toplevel, those should be listed in `bs-dependencies` and `pinned-dependencies`)
18
23
- Normal dependencies (these are packages that are consumed from npm and listed via `bs-dependencies`)
19
24
20
25
Whenever a package is being built (`bsb -make-world`), the build system will build the toplevel package with its pinned-dependencies. So any changes made in a pinned dependency will automatically be reflected in the final app.
21
26
22
-
## Build System Package Rules
27
+
###Build System Package Rules
23
28
24
29
The build system respects the following rules for each package type:
25
30
@@ -44,6 +49,8 @@ The build system respects the following rules for each package type:
44
49
- Ignores pinned dependencies
45
50
- Ignores custom generator rules
46
51
52
+
So with that knowledge in mind, let's dive into some more concrete examples to see our `pinned dependencies` in action.
0 commit comments