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
Hey, nx@21 introduced a new React Router plugin for react apps, allowing to build applications using react-router v7.
That setup works fine OOTB, the nx executor calls react-router build and the generated artifact contains a "server/index.js" that can be used as an entrypoint for a production server: react-router-serve build/server/index.js
I was then wondering how to add docker support for such project, in order to deploy that project to {ECS, Cloud Run, ACA ... insert name of other docker based infrastructure solution}?
React Router has some documentation on deployment, as well as several templates showing how to add docker support, such as the node-postgres example
But in the context of an nx project, the generated build folder does not contain a package.json or package manager lockfile that can be used to install the pruned dependencie, like @nx/js:prune-lockfile does.
The root package.json may contain a lot of dependencies unrelated to react & react-router (backend node apps or such)
Would adding custom executors based on @nx/js to generate a package.json and lockfile be the way to go, or how should that be approched?
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, nx@21 introduced a new React Router plugin for react apps, allowing to build applications using react-router v7.
That setup works fine OOTB, the nx executor calls
react-router buildand the generated artifact contains a "server/index.js" that can be used as an entrypoint for a production server:react-router-serve build/server/index.jsI was then wondering how to add docker support for such project, in order to deploy that project to {ECS, Cloud Run, ACA ... insert name of other docker based infrastructure solution}?
React Router has some documentation on deployment, as well as several templates showing how to add docker support, such as the node-postgres example
But in the context of an nx project, the generated build folder does not contain a package.json or package manager lockfile that can be used to install the pruned dependencie, like @nx/js:prune-lockfile does.
The root package.json may contain a lot of dependencies unrelated to react & react-router (backend node apps or such)
Would adding custom executors based on
@nx/jsto generate a package.json and lockfile be the way to go, or how should that be approched?Beta Was this translation helpful? Give feedback.
All reactions