From 0fe857c5acab550c2cad933834f669a3c87191c8 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Wed, 24 Aug 2022 17:42:56 +0100 Subject: [PATCH] Docs: move serverless-esbuild to bundlers section --- docs/install.md | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/docs/install.md b/docs/install.md index 917947e6..bc4d4375 100644 --- a/docs/install.md +++ b/docs/install.md @@ -255,26 +255,6 @@ SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --arch=x64 --platform=linux --libc=gli To get the best performance select the largest memory available. A 1536 MB function provides ~12x more CPU time than a 128 MB function. -### serverless-esbuild - -To deploy AWS Lambda using serverless framework, esbuild and serverless-esbuild on machines other than Linux x64 (glibc), first ensure sharp is excluded from bundling via the -[external option](https://www.serverless.com/plugins/serverless-esbuild#options) -configuration. -Make changes inside `serverless.yml` under `esbuild` with the following. -``` -custom: - # Keep existing changes - esbuild: - # Keep existing changes - external: - - sharp - packagerOptions: - scripts: - - npm install --arch=x64 --platform=linux sharp -``` -After successful deployment, comment out the scripts `- npm install --arch=x64 --platform=linux sharp` if you want to use `serverless-offline` - - ## Bundlers ### webpack @@ -308,6 +288,19 @@ buildSync({ esbuild app.js --bundle --platform=node --external:sharp ``` +For `serverless-esbuild`, ensure platform-specific binaries are installed +via the `serverless.yml` configuration. + +```yaml +custom: + esbuild: + external: + - sharp + packagerOptions: + scripts: + - npm install --arch=x64 --platform=linux sharp +``` + ## Fonts When creating text images or rendering SVG images that contain text elements,