-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Unexpected import.meta.url value when bundling #6344
Comments
The bundle needs to hardcode the path, as they are no longer independent modules. What would you expect the behaviour to be, considering it needs to be unique for each module that is part of the bundle. |
@kitsonk I expected for |
That assumption might work in certain situations, but others might want to preserve the url at bundle time so each module has its own url. Looking at Rollup, it is configurable to preserve it or to reflect the runtime environment. My feeling is that if the module is a local module, it should have a path based on the runtime |
I think that wouldn't be possible for some cases. Example: Is there something equivalent to |
@jsejcksn |
@jsejcksn does |
@bartlomieju No.
|
@jsejcksn I'm a bit confused. (Also, we don't keep issues open for stabilisation. It's not helpful for tracking.) |
Thanks for informing, and I understand. Are you saying "there's simply not a stable way to get a relative path to the main module at runtime"? |
There's simply a lot of not stable ways to do things, until those APIs are stabilised. |
@kitsonk Right. I could use I know that things are evolving, but how do I track that specific problem if the issue is closed? |
Release notes. The issue tracker is for maintainer convenience. |
If we feel that there are no questionable semantics about how But it is better to keep the issues opened focused on specifically what needs to be done. |
@nayeemrmn I disagree. Parsing every release notes content for keywords related to an issue is not a method of tracking.
I certainly understand using GitHub Issues in this specific capacity—it seems maximally helpful to contributors and maintainers. However, this is my experience with a lot of software: there is no afforded mechanism for problem reporters to actually track progress related to the reported problems. I didn't intend for this to fork into a meta discussion about how Issues are used. If further discussion about this topic is desired, is there a suitable place for it?
Understood. Back to the original topic: before closing, I'm wondering if it's possible to expose the rollup option you mentioned for relative/absolute path references to each bundled module's |
But as you mention, that becomes a challenge when a local module is outside of the root of the main module. Given your specific use case |
@kitsonk Regarding |
No, sounds logical that we would keep it here. I've added it to #4549. |
@jsejcksn Can you edit the title of this issue be about the If it's still contended, the current behaviour of |
Ok; what title would you like? |
As of Deno 1.5 the behaviour of There is the issue of #8088 which raises issues with that behaviour and will be addressed in future versions of Deno. Any other suggestions or thoughts about the behaviour should be added to #8088. |
@kitsonk I'm not sure I understand. When is |
The output of the unit test here demonstrates it: https://github.com/denoland/deno/blob/master/cli/tests/bundle/fixture06.out. When the module is a root/entry module |
@kitsonk Thanks, that was very clear. |
It seems `import.meta.url` is HARDCODED after `deno bundle` denoland/deno#6344
I've noticed that when using paths relative to
import.meta.url
, the bundle hardcodes the path. Here is an example:Is this the expected behavior, or is it a bug? If expected, how do I accommodate for this?
The text was updated successfully, but these errors were encountered: