-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Expose information about import assertions #73
Comments
@LarsDenBakker I think we should build this directly into the core project, just like SystemJS supports - https://github.com/systemjs/systemjs/blob/main/src/extras/module-types.js. Steps:
What is the status on HTML modules these days? |
Great to hear! Import assertions were stalling progress for a while, but JSON module is stage 3 and CSS modules is making progress https://groups.google.com/a/chromium.org/g/blink-dev/c/vCrJCQxNnzo/m/OAYI9cPWAQAJ?pli=1. I'm not sure about the current status of HTML modules |
Is it possible to include the start and end position of the import assertion? For my case I'd have to remove the actual import assertion from the code. es-module-shims will have to do this as well I think? |
@LarsDenBakker thanks for the suggestions - I've added these features in #74, review would be very welcome there. |
I am looking into polyfilling the new upcoming module types (JSON, CSS, HTML etc.). To do this it would be great if we can find out in a lightweight way whether an import is done using an import assertion. Is this something that could be added to ex module lexer?
For an import like this:
And this would tell use that the import assertion is JSON.
The proposal for import assertions is here: https://github.com/tc39/proposal-import-assertions
The text was updated successfully, but these errors were encountered: