Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.
This repository was archived by the owner on May 22, 2024. It is now read-only.

Allow Functions to be pure ES modules #750

@ehmicky

Description

@ehmicky

Parent issue: https://github.com/netlify/pod-workflow/issues/321

Users can currently use import/export statements in their Functions when using the esbuild 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:

  • Supporting new package.json fields related to pure ES modules (like exports and imports)
  • Using import.meta.resolve() instead of require.resolve()
  • Not using __dirname nor __filename
  • Not importing JSON files directly

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: chorework needed to keep the product and development running smoothly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions