This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Allow Functions to be pure ES modules #750
Labels
type: chore
work needed to keep the product and development running smoothly
Comments
ehmicky
added
the
type: chore
work needed to keep the product and development running smoothly
label
Oct 15, 2021
I can't certainly say what needs to be done/fix or if pure ESM works or not, i don't use netlify or aws lambda. But from my understanding AWS Lambda can run pure ES modules. but they need to be imported using lazy import Behind the scenes AWS uses |
This was referenced Oct 18, 2022
Closed
This would be awesome! 🤓 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Parent issue: https://github.com/netlify/pod-workflow/issues/321
Users can currently use
import
/export
statements in their Functions when using theesbuild
bundler, which transpiles those to CommonJS before we ship it to AWS Lambda.However, Functions can still not be pure ES modules (see this list for the differences). We should support it.
Some specific points we would check:
package.json
fields related to pure ES modules (likeexports
andimports
)import.meta.resolve()
instead ofrequire.resolve()
__dirname
nor__filename
Also, we would need to confirm that AWS Lambda can run pure ES modules.
Related (but separate) issue to refactor this repository to use pure ES modules: #749
The text was updated successfully, but these errors were encountered: