Skip to content

Respect package.json type: module for ESM Functions #531

@aaronpowell

Description

@aaronpowell

The preview support for ESM (ES6) modules available (#104 for tracking) requires the use of mjs file extensions (https://github.com/Azure/azure-functions-nodejs-worker/blob/v3.x/src/FunctionLoader.ts#L31 for source reference) which is a bit of a pain when it comes to working with TypeScript, you need to use the nightly compiler to output a mjs extension.

It would be good if the worker would respect the type field in package.json and if that is set to module it loads them as ESM rather than commonjs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions