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

feat: add support for import maps with ESZIP #109

Merged
merged 4 commits into from
Sep 13, 2022
Merged

Conversation

eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Sep 9, 2022

Support for import maps was limited when producing ESZIP bundles, because thee loader function wasn't being called for specifiers that looked like relative file paths, and therefore those were not respecting the import map.

With this PR, we're using native support for import maps in https://deno.land/x/eszip@v0.28.0 rather than resolving them ourselves in the loader function.

NOTE: Netlify Build will need to start sending a baseURL property with the path of the import map file itself (here), so that we know how to resolve any relative paths in the import map.

Closes #108.

BREAKING CHANGE: `importMaps` now expects a `baseURL` containing the URL of the import map file
@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Sep 9, 2022
@eduardoboucas eduardoboucas marked this pull request as ready for review September 9, 2022 12:04
@eduardoboucas eduardoboucas requested a review from a team September 9, 2022 12:04
@kodiakhq kodiakhq bot merged commit 19031eb into main Sep 13, 2022
Skn0tt pushed a commit to netlify/build that referenced this pull request Apr 23, 2024
* feat: add support for import maps with ESZIP

BREAKING CHANGE: `importMaps` now expects a `baseURL` containing the URL of the import map file

* refactor: simplify import map parsing

* refactor: use `URL` objects internally

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bundling fails when trying to use an importMap
2 participants