-
Notifications
You must be signed in to change notification settings - Fork 266
Importmap support #1135
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
Importmap support #1135
Conversation
f6e80d1
to
cd9466d
Compare
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| { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
6ebae5f
to
acf06fd
Compare
fix #1129