Docs: add section about Webpack configuration

This commit is contained in:
Lovell Fuller 2021-01-29 11:29:24 +00:00
parent 6dffb47973
commit 0dc325daa4
2 changed files with 13 additions and 1 deletions

View File

@ -192,6 +192,18 @@ docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm install sharp
To get the best performance select the largest memory available.
A 1536 MB function provides ~12x more CPU time than a 128 MB function.
## Webpack
Ensure sharp is added to the
[externals](https://webpack.js.org/configuration/externals/)
configuration.
```js
externals: {
'sharp': 'commonjs sharp'
}
```
## Worker threads
The main thread must call `require('sharp')`

File diff suppressed because one or more lines are too long