From f2a610725ded49525f979702b5b4d2673edc9fd7 Mon Sep 17 00:00:00 2001 From: Mischa Spiegelmock Date: Fri, 16 Dec 2022 19:08:20 -0800 Subject: [PATCH] Simplify README --- README.md | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/README.md b/README.md index c516d3a1..2acf3625 100644 --- a/README.md +++ b/README.md @@ -17,50 +17,9 @@ import { Nextjs } from 'cdk-nextjs-standalone'; new Nextjs(this, 'Web', { nextjsPath: './web', // relative path to nextjs project root - - // Bucket that contains your app's images for optimizations. - // If not provided, internal assets bucket will be used. - imageOptimizationBucket: myImageBucket, }); ``` -### Image Optimization - -All requests to `"/_next/image?url=..." ` will be routed to a separate image optimization lambda. To take advantage of this feature, use the `` component as: - -```ts -// MyPage.tsx -import Image from 'next/image' - -function MyPage() { - return ( - <> - {...} - {...} - - ) -} -``` - -Note: the `` component handles the URL encoding and prefixes the `src` with `"/_next/image?url=..."` - -If you need to optimize external images, configure `next.config.js`: -(Please see [doc](https://nextjs.org/docs/api-reference/next/image#remote-patterns) on domain patterns.) - -```ts -// next.config.js -const nextConfig = { - ... - images: { - remotePatterns: [ - { - hostname: "**.unsplash.com", - }, - ], - }, -}; -``` - ## Documentation Available on [Construct Hub](https://constructs.dev/packages/cdk-nextjs-standalone/).