Replies: 1 comment
-
managed to get it to work! node added a change in March of last year that allows you to specify an "imports" field which essentially works the same way as "paths" in tsconfig.json zemn-me/monorepo@5538c1d |
Beta Was this translation helpful? Give feedback.
0 replies
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've been using absolute imports via NODE_PATH for some time now. This has been chugging along just wonderfully with aspect_rules_js. However, I am trying to migrate to ESM so I can use the latest versions of some libraries, and ESM support in Node specifically removes NODE_PATH functionality.
It is suggested by the Node team that symlinks are created to get an absolute import effect – in the original rules_js, I used link_workspace_root which implemented this feature, however this was removed in aspect_rules_js.
I naiively tried creating a symlink in
//:node_modules
that goes to..
, but this created an awful loop that made Node very sad:Error Log
I've considered solving this by moving the entire monorepo up one directory (called 'monorepo') and symlinking that. But before I take such a drastic step, I was hoping there were other options.
Thanks for any help in advance!
Beta Was this translation helpful? Give feedback.
All reactions