Include `.bin` in `npm_install` and `yarn_install`
🚀 feature request
Relevant Rules
npm_install, yarn_install
Description
I currently cannot directly use the yarn_install repo :node_modules when building a container_layer for deploying a NextJS app in a container with a the start command yarn start. The root node_modules/.bin is missing.
Describe the solution you'd like
Include the root .bin directory in npm_install, yarn_install when referencing the :node_modules. The use case would be wrapping everything up in the end like:
# Combine tars generated from genrule (to run next build) or pkg_tar
container_image(
name = "image",
base = "@node_alpine_16_13//image",
cmd = ["yarn", "start"],
data_path = "/",
env = {
"NODE_ENV": "production",
},
ports = ["3000"],
tars = [
":app-node-modules.tar",
":app-static",
":app-next.tar",
],
workdir = "/app/",
)
Or is there another suggested method for packaging up an app that is not completely Bazel-ified? Is there a reason why it needs to be excluded?
My debugging session repo for figuring out .bin was missing.
Describe alternatives you've considered
Symlink the individual .bin files manually.
what is the status of this bug? any workaround to generate .bin folder in node_modules?
@kriswuollett @alexeagle any workaround to generate .bin folder in node_modules?
I don't have a workaround at the moment. I'm just not using Bazel for NextJS projects.
This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!
This issue was automatically closed because it went 30 days without any activity since it was labeled "Can Close?"