-
Notifications
You must be signed in to change notification settings - Fork 470
es6-global modules have incorrect paths when compiling dependencies via npm link #1691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This seems to be a hard problem, do you have any suggestions. |
Sorry, I only looked at the email notification at the time which was before you edited in the other details, and then filed it away and only just noticed it! I haven't hit the problem since I completed development of the library I was linking at the time. I have two ideas:
|
Is this issue still relevant? 3 years since the last update. |
It’s not October yet 😉 I don’t use es6-global anymore so I can’t check, unfortunately. |
I think it's still there due to the monorepo issue |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm experimenting with a project setup where I develop both the main library and a dependency at the same time. I have both repositories local on my machine during development. This works well enough if I
npm install
the dependency from the local filesystem, but then I need to reinstall after every change in the dependency. I would like to usenpm link
to solve this, butbsb
is producing incorrect paths fores6-global
modules when I try.Given the folder structure in the attached tarball, run the following commands:
If you then
cat lib/es6_global/src/foo.js
, Bar is referenced asimport * as Bar from "../../../node_modules/bar/lib/es6_global/src/bar.js";
which is loading it via the symlink.However, if you
cat node_modules/bar/lib/es6_global/src/bar.js
, the path to the stdlib is wrong:import * as $$String from "../../../../foo/node_modules/bs-platform/lib/es6/string.js";
This appears to have resolved the real filesystem location of the stdlib in
foo
relative tobar.js
, ignoring the fact that it was compiled as a symlinked dependency. In other words it will work ifbar.js
is loaded from the real filesystem location, but not the symlink location (and as shown abovefoo.js
is loading it through the symlink).I can think of two solutions:
bar
, use stdlib references that work via the symlinkfoo
, refer tobar
through the actual filesystem location instead of via the symlinkI don't think option 1 is really viable though, as it would mean that moving back to working in the
bar
project directly leaves you with compiled output that no longer works.The text was updated successfully, but these errors were encountered: