Dynamically importing relative paths
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 546
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
In comparing the dimport legacy importer with Chrome's native importer, I am noticing a discrepancy in how paths are resolved.
In chrome, I see the following happening...
Given the following structure:
/index.html
/foo/main.js
/foo/dynamic-component.js
if /foo/main.js has the following code
```
import('./dynamic-component.js');
```
Chrome loads the file fine. When testing in Firefox using the legacy importer it is looking for the file in /dynamic-component.js instead of /foo/dynamic-component.js and 404s. I haven't tested the module/nomodule versions to see if there is any difference with them.
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.
Research direction
Reproduce the example with /index.html, /foo/main.js, and /foo/dynamic-component.js using the dimport legacy importer in Firefox, then compare it with Chrome's native importer. Trace how the legacy importer resolves import('./dynamic-component.js'); done means it requests /foo/dynamic-component.js rather than /dynamic-component.js.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100