Just for clarification, to convert a Node 14 Lambd...
# help
d
Just for clarification, to convert a Node 14 Lambda from being bundled as CJS to being bundled as ESM, all that is required is to mark https://docs.serverless-stack.com/constructs/Function#format to
esm
? All should be well, tree-shook, etc?
r
I think Dax has this has all been sorted out now, though you will wanna be on a version after this landed. https://github.com/serverless-stack/serverless-stack/commit/1f1e45f27ffd513c2aa4d5196490faded33d71cb
Generally esbuild has been pretty good at shaking things out, however I have had to add
/*@__PURE__*/
comments occasionally to make sure it knew its cool to drop it.
f
Thanks @Ross Gerbasi.
@Derek Kershner yeah setting
bundle.format
should just work. Let us know if otherwise.