AnomalyInnovations / serverless-bundle

Optimized packages for ES6 and TypeScript Node.js Lambda functions without any configuration.
https://serverless-stack.com/chapters/package-lambdas-with-serverless-bundle.html
MIT License
536 stars 157 forks source link

Option to disable AMD loader #171

Open Ionut-Milas opened 3 years ago

Ionut-Milas commented 3 years ago

Hello.

I am using the SendInBlue SDK to send email from SLS function, but I encounter the following issue "Module not found: Error: Cannot resolve module". In the SDK documentation, they say that I should disable the AMD loader in webpack. How do you suggest I should proceed with this, as I cannot add serverless-webpack alongside serverless-bundle. Can support for this issue be added directly in the bundle ?

Best regards.

jayair commented 3 years ago

Hi there, how would the AMD loader be disabled in Webpack?

ashsmith commented 2 years ago

I've ran into this issue too. AMD can be disabled in webpack by setting: amd: false within the config https://webpack.js.org/configuration/other-options/#amd

In my case this package was causing the issue: https://github.com/tyrasd/jxon/blob/master/jxon.js#L27

I'll look into raising a PR to add an optional setting to disable.