The `Function` construct has support for esm as we...
# sst
m
The
Function
construct has support for esm as well as the necessary shim, but even if that option is used, it still outputs a .js file instead of .mjs. https://github.com/serverless-stack/serverless-stack/blob/master/packages/core/src/runtime/handler/node.ts#L53. Is there a reason for that or is that an oversight? Is the shim even needed for .js files?
Tested it and I guess it doesn’t make any difference what the extension is.
t
Right now it outputs a package.json with type: module
That makes node treat it all as esm
I do want to switch it to being mjs for explicitness
m
Got it, thanks. I was comparing it to NodejsFunction which does set the extension.