| 1 | import * as Alchemy from "alchemy"; |
| 2 | import * as AWS from "alchemy/AWS"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | |
| 5 | export default Alchemy.Stack( |
| 6 | "AwsWebsiteNextjsExample", |
| 7 | { |
| 8 | providers: AWS.providers(), |
| 9 | state: AWS.state(), |
| 10 | }, |
| 11 | Effect.gen(function* () { |
| 12 | const site = yield* AWS.Website.Nextjs("Nextjs", { |
| 13 | // Only hash the files that affect the build, so unchanged sources |
| 14 | // skip the OpenNext build (and the deploy) entirely. |
| 15 | memo: { |
| 16 | include: [ |
| 17 | "app/**", |
| 18 | "public/**", |
| 19 | "package.json", |
| 20 | "next.config.mjs", |
| 21 | "postcss.config.mjs", |
| 22 | "open-next.config.ts", |
| 23 | "tsconfig.json", |
| 24 | ], |
| 25 | }, |
| 26 | forceDestroy: true, |
| 27 | env: { |
| 28 | GREETING: "Hello from Next.js on AWS!", |
| 29 | }, |
| 30 | }); |
| 31 | |
| 32 | return { |
| 33 | url: site.url, |
| 34 | }; |
| 35 | }), |
| 36 | ); |