Skip to content
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

import.meta.url stays original after compilation, how to get compiled file path #911

Open
sbcgua opened this issue Apr 8, 2022 · 2 comments

Comments

@sbcgua
Copy link

sbcgua commented Apr 8, 2022

Let's suppose a file located at /<packagerootdir>/lib/xyz/someaction.js. After compilation I place the resulting file in e.g. /app/dist/index.js. The someaction.js used import.meta.url to find it's location. And it was working well in the uncompiled code. But for the compiled import.meta.url returns /app/lib/xyz/someaction.js. So:

  1. This is incorrect because /app/lib/xyz/someaction.js does not exist
  2. This is incorrect because the index.js is actually in /app/dist ... and dist part is missing in the resulting path anyway
  3. Finally it is not clear how to get compiled index.js path properly.
@styfle
Copy link
Member

styfle commented Apr 8, 2022

Sounds like #897 will fix this

@sbcgua
Copy link
Author

sbcgua commented Apr 9, 2022

Looks promising indeed, thanks ! Will follow that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants