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
{{ message }}
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.
I am trying to use Bazel to develop dockerized nodejs apps on a local kubernetes cluster.
Seems like the Bazel way is to compile all sources and dependencies down into a single js file and then add that to the container. That seems to work fairly well till:
you have a native node module
your IDE is not aware of node_modules installed by bazel
your IDE is not aware of bazel dependencies (the ts language server is not aware of bazel deps from ts_library targets)
I am not sure how to solve issue 1 yet. Figuring out which of your node modules are native seems difficult, and then creating a docker image that has them compiled with the correct toolchain seems like something that Bazel isn't all that good at yet.
Issue 2 can be solved by running a yarn install at the workspace root as long as everyone is willing to put all npm dependencies in the package.json at the repo root.
I would really appreciate an example of a monorepo that produces nodejs docker images from someone more experienced in Bazel. Bonus points if it can use something like skaffold for quick development iteration.
Currently, for a dockerized nodejs app I am using something like:
I am trying to use Bazel to develop dockerized nodejs apps on a local kubernetes cluster.
Seems like the Bazel way is to compile all sources and dependencies down into a single js file and then add that to the container. That seems to work fairly well till:
I am not sure how to solve issue 1 yet. Figuring out which of your node modules are native seems difficult, and then creating a docker image that has them compiled with the correct toolchain seems like something that Bazel isn't all that good at yet.
Issue 2 can be solved by running a
yarn install
at the workspace root as long as everyone is willing to put all npm dependencies in the package.json at the repo root.The only way to solve issue 3 seems to be to use path mapping or project references in your
tsconfig.json
file.I would really appreciate an example of a monorepo that produces nodejs docker images from someone more experienced in Bazel. Bonus points if it can use something like skaffold for quick development iteration.
Currently, for a dockerized nodejs app I am using something like:
./WORKSPACE
./BUILD.bazel
./libs/shared-package/BUILD.bazel
./services/base-image/BUILD.bazel
./services/my-service/BUILD.bazel
./services/my-service/server/BUILD.bazel
The text was updated successfully, but these errors were encountered: