Skip to content

Commit dc7cf16

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

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

β€ŽREADME.md

+25
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,31 @@ 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+
Given
837+
```
838+
.
839+
β”œβ”€β”€ app1
840+
β”‚ β”œβ”€β”€ spago.yaml
841+
β”‚ └── src
842+
β”‚ └── Main.purs
843+
β”œβ”€β”€ app2
844+
β”‚ β”œβ”€β”€ spago.yaml
845+
β”‚ └── src
846+
β”‚ └── Main.purs
847+
└── spago.yaml
848+
```
849+
850+
, to avoid the error `Module Main has been defined multiple times`:
851+
* `app1` `Main.purs` can have `module Main1`
852+
* `app2` `Main.purs` can have `module Main2`
853+
854+
From the root, run:
855+
* `spago run -p app1 --main Main1`
856+
or
857+
* `spago run -p app2 --main Main2`
858+
834859
### Polyrepo support
835860
836861
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)