In my environment (aws-lambda) I have the aws-sdk set up, so in the webpack.config i've added:
externals: {
'aws-sdk': 'aws-sdk'
},
When building it seems to set it as module.exports = aws-sdk; instead of module.exports = require('aws-sdk'); weird thing was it was working fine before, just randomly stopped, any ideas?
(using serverless-webpack and webpack)
Finally figured out by finding these docs: https://webpack.github.io/docs/configuration.html#externals
Had to have output: { libraryTarget: "commonjs" }, set
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With