-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Use import.meta.url in EXPORT_ES6 mode #7137
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
Comments
https://aremodulesready.com/ The availability for |
It was just added in Firefox 62. Edge support is still lacking. Detecting its support could be tricky? I'm not sure if it will throw a syntax error in browsers which don't support it. At the very least it's needed for Node, and supported in Node. Maybe leave browsers till later when it's reached stage 4. |
It's tricky because |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Follow on to #5368. When in EXPORT_ES6 mode
import.meta.url
should be used. In browsersdocument.currentScript
will probably still work, but__dirname
will not work in Node.import.meta.url
is supported in both, and it's cleaner and safer.The text was updated successfully, but these errors were encountered: