This repository has been archived by the owner on May 22, 2024. It is now read-only.
Allow Functions to be pure ES modules #750
Labels
type: chore
work needed to keep the product and development running smoothly
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: