Skip to content

Commit 122d5a2

Browse files
committed
monorepo multiple main modules documentation
1 parent 5388cb5 commit 122d5a2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

β€ŽREADME.md

+21
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,27 @@ The `--package` flag is also available for many more commands, such as `build`,
831831

832832
An important property of this "monorepo setup" is that the `output` folder will be shared between all the packages: they will share the same build package set (or build plan when using the solver) and they will be all build together.
833833

834+
#### Multiple Main Modules
835+
836+
```
837+
.
838+
β”œβ”€β”€ app1
839+
β”‚ β”œβ”€β”€ spago.yaml
840+
β”‚ β”œβ”€β”€ src
841+
β”‚ └── Main.purs
842+
β”œβ”€β”€ app2
843+
β”‚ β”œβ”€β”€ spago.yaml
844+
β”‚ β”œβ”€β”€ src
845+
β”‚ └── Main.purs
846+
└── spago.yaml
847+
```
848+
849+
To avoid the error `Module Main has been defined multiple times`:
850+
* `app1` `Main.purs` can have `module Main1`
851+
* `app2` `Main.purs` can have `module Main2`
852+
853+
From the root, you may run `spago run app1 --main Main1` or `spago run app2 --main Main2`.
854+
834855
### Polyrepo support
835856
836857
There might be cases where you want to have multiple loosely-connected codebases in the same repository that do _not_ necessarily build together all the time. This is sometimes called [a "polyrepo"][monorepo-tools].

0 commit comments

Comments
Β (0)