I’m re-organizing several unrelated typescript projects into a mono-repo structure. Currently I’m able to compile each one individually just fine with tsc
. I would like to have something like a “build-all” script in the base package.json
. Here’s an example of my project structure:
packages/
| foo/
| | src/
| | | index.ts
| | package.json
| | tsconfig.json
| bar/
| | src/
| | | index.ts
| | package.json
| | tsconfig.json
| asd/
| | src/
| | | index.ts
| | package.json
| | tsconfig.json
package.json
(Site note: Unfortunately, all of my tsconfig
s are the same, I haven’t figured out how to break them out into one file but still have each project compile to its respective dist
.)
./packages/foo/package.json
contains this simple build script:
"scripts": {
"build": "tsc"
}
./package.json
contains this build script:
"scripts": {
"build-all": "tsc -p packages/foo -p packages/bar -p packages/asd",
}
It works, but definitely not ideal, especially when I continue to add packagaes. I want to do something like this:
"scripts": {
"build-all": "tsc -p packages/*",
}
Is this possible?