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
I'm currently trying to solve an issue with our builds for deployments.
We have a monorepo structured in the following way
./apps/api/
./apps/queue-server/
./apps/api-legacy/
./libs/core/
./libs/shared-types/
./libs/other-lib
And we use typescript in all the libs and apps, which are linked together via ts projects.
We then use "workspace:^" as the version for these packages in the package.json.
Some packages are dependent on each e.g.
api -> core -> shared-types
api -> core -> other-lib
api -> core -> other-lib -> shared-types
To build the api we now need to copy all of the needed files (src/, package.json, tsconfig.json) of each lib and the app files into our Docker image and build inside there.
With every change of a package e.g. adding a new file that is needed for the build we need to update all Dockerfiles for every app.
Is there a solution like yarn pack to be run inside the api folder, that bundles all needed deps locally so we can copy it into the docker image with less manual effort?
I've already found yarn.build but this seems to not work correctly with non-pnp projects (as we use nodeLinker: node-modules and nmHoistingLimits: workspaces)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey everyone,
I'm currently trying to solve an issue with our builds for deployments.
We have a monorepo structured in the following way
./apps/api/
./apps/queue-server/
./apps/api-legacy/
./libs/core/
./libs/shared-types/
./libs/other-lib
And we use typescript in all the libs and apps, which are linked together via ts projects.
We then use "workspace:^" as the version for these packages in the package.json.
Some packages are dependent on each e.g.
api -> core -> shared-types
api -> core -> other-lib
api -> core -> other-lib -> shared-types
To build the api we now need to copy all of the needed files (src/, package.json, tsconfig.json) of each lib and the app files into our Docker image and build inside there.
With every change of a package e.g. adding a new file that is needed for the build we need to update all Dockerfiles for every app.
Is there a solution like
yarn pack
to be run inside the api folder, that bundles all needed deps locally so we can copy it into the docker image with less manual effort?I've already found yarn.build but this seems to not work correctly with non-pnp projects (as we use
nodeLinker: node-modules
andnmHoistingLimits: workspaces
)Thank in advance
Beta Was this translation helpful? Give feedback.
All reactions