Skip to content

Conversation

krichprollsch
Copy link
Member

fix #1129

@krichprollsch krichprollsch self-assigned this Oct 9, 2025
pub fn resolveSpecifier(self: *ScriptManager, arena: Allocator, _specifier: []const u8, base: []const u8) ![:0]const u8 {
var specifier = _specifier;
// If the specifier is mapped in the importmap, use it to resolve the path.
if (self.importmap.get(specifier)) |s| {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect the URLs in the import map to be resolved based on the document's URL and not the referrer of the module. If that's the case, then

1 - When populating importmap, the imports need to be resolved against page.url
2 - In this function, when found, it should be returned directly from the map

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now

krichprollsch and others added 2 commits October 10, 2025 08:02
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
@krichprollsch krichprollsch merged commit b53c2bf into main Oct 10, 2025
10 checks passed
@krichprollsch krichprollsch deleted the importmap branch October 10, 2025 07:33
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS Import maps

3 participants