Best practice for deploying dependencies used with link_workspace_root #2488
Unanswered
EliSchleifer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking for some guidance / ideas on which of the myriad tools to use to properly deploy a nodes js and dependencies such that the file structure will work correctly with a VS Code extension while utilizing link_workspace_root
Take for example this setup
/root
/foo:foo
/bar:bar
Where bar has a dep on foo and imports types from foo as
import { * } from root/foo/foo
When compiling my ts_library for bar with the deps /foo the file are obviously not going to layout and run correctly.
Output in bazel-bin would look something like
bazel-bin/bar/bar.js and inside bar.js we'll have an import statement 'root/foo/foo' but root doesn't exist in the bazel-bin tree. Reading the shell commands that are generated by node_binary rule there appears to be a bunch of hacking to fix up how these imports are read. But in the case of a VS Code extension my entrypoint cannot be controlled.
I was wondering if any of the rollup/packaging rules could be used to properly make a deployment that looks like
/
/node_modules/root/foo/foo.js
/bar.js
Since node will search in node_modules to try to find the files for import.
Maybe this is a totally solved problem or solvable another way (it probably is). I figured this community would have thoughts.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions