Closed HaaLeo closed 8 months ago
Currently the package cannot be used within an ESModule. When one tries to do so you get an error like
ReferenceError: require is not defined
Unfortunately the approaches mentioned in #89 do not work for me since I have concurrent initialization.
I am bundling my lambda function with webpack.
With the package as an esmodule we can take advantage of top level awaits to further reduce cold start times.
No response
I think I might have missconfigured webpack node-externals. Adding the following config seems to remediate the error message:
externals: [nodeExternals({ importType: 'module' })],
Prerequisites
🚀 Feature Proposal
Currently the package cannot be used within an ESModule. When one tries to do so you get an error like
Unfortunately the approaches mentioned in #89 do not work for me since I have concurrent initialization.
I am bundling my lambda function with webpack.
Motivation
With the package as an esmodule we can take advantage of top level awaits to further reduce cold start times.
Example
No response