import.meta.url stays original after compilation, how to get compiled file path
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, nodejs
- Domain
- build-system
Research direction
Reproduce the reported behavior with a source file using import.meta.url and the two paths described in the issue. Then inspect ncc's handling of import.meta.url during compilation and establish whether the compiled output can resolve its deployed location; done means the behavior is fixed or the limitation and supported approach are clearly documented.
Written by the indexing model from the issue text.
Description
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:
- This is incorrect because
/app/lib/xyz/someaction.jsdoes not exist - This is incorrect because the
index.jsis actually in/app/dist... anddistpart is missing in the resulting path anyway - Finally it is not clear how to get compiled
index.jspath properly.
- Dominant language
- JavaScript
- Stars
- 9.8k
- Forks
- 326
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/ncc
-
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
-
Typescript 7 support Openhelp wanted
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
bug help wanted
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
ncc build generating multiple index.js files instead of a single bundle after upgrading Node.js Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100