Open zhihao-gong opened 9 months ago
Hi just got the same issue in https://github.com/aspect-build/rules_js/issues/1884 and I notice that you need to reference the hoisted dependency in root package instead of that in sub package. e.g. //:node_modules/@vue/cli-plugin-babel
instead of //my-vue-project:node_modules/@vue/cli-plugin-babel
.
Note: No need to install @vue/cli-plugin-babel
to root package.
What happened?
I am migrating my vue project to
bazel
andrules_js
.I used
@vue/cli-service@4.5.19
which transitively uses plugins such as@vue/cli-plugin-babel
, but without declaring it independencies
. So I plan to usepublic_hoist_packages
to make@vue/cli-service
aware of@vue/cli-plugin-babel
. But thepublic_hoist_packages
field did not hoist@vue/cli-plugin-babel
inbazel-bin/node_modules
.Based on docs,
public_hoist_packages
will do the same thing aspublic-hoist-pattern
inpnpm
. I also tried bazelbuild/examples/frontend and didn't see changes inbazel-bin/node_modules
either.Version
Development (host) and target OS/architectures:
x86_64 GNU/Linux ubuntu focal
Output of
bazel --version
:bazel 7.0.0
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:rules_js
version is1.34.1
How to reproduce
I built all targets in
bazelbuild/examples/frontend
and didn't see hoisting inbazel-bin/node_modules
I tried
pnpm i
withpublic_hoist_pattern
which did the hoisting innode_modules
directory.