Reputation: 347
I have project on serverless framework. I need to resize image. I wrote lambda function and install module sharp
. Also I use serverless-webpack
. In webpack I add externals: ['sharp']
and add in serverless.yml next:
custom:
webpack:
includeModules:
packagePath: './src/package.json'
I deployed it successfully but when I run lambda I get
error: Cannot find module 'sharp' maybe I doing something wrong. If need more information I can write it.
Upvotes: 0
Views: 588
Reputation: 22403
You can use forceInclude
# serverless.yml
custom:
webpack:
includeModules:
forceInclude:
- sharp
Upvotes: 1