My fellow yarn workspace typescript monorepo-nians,
Question: When you are working within a monorepo are you able to import and use source code across packages or do you rely on the build steps artifact to use a package from a separate package?
For example you have this folder structure
packages/
frontend/
api/
dateTimeHelpers/
src/
dist/
Both frontend/ and api/ have a dependency on the dateTimeHelpers package
frontend/ + api/ package.json
dependencies: {
dateTimeHelpers: "1.0.0"
}
You are running frontend , hot reloading and the like and want to add a function to the dateTimeHelpers package and use said function within the frontend package
Do you have to compile the dateTimeHelpers package (aka frontend is using the dateTimeHelpers/dist folder), or will your frontend import the src code from dateTimeHelpers and compile it on the fly (or just when it builds)?
All the packages are written in TypeScript and require a build step in order to be used.
Thank you for entertaining this. I am having a hard time seeing what I should be shooting for. I have dist usage working - but I would like to not be running two build commands or have to build ad-hoc when developing.
Cheers