t3-code-android-nightly/.repos/alchemy-effect/examples/aws-website-sveltekit
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00
..
src chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
static chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
test chore(refs): sync Effect and Alchemy references to rc.115 and beta.78 (#12327) 2026-09-17 23:21:25 -07:00
.gitignore chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
alchemy.run.ts chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
package.json chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170) 2026-10-05 13:22:30 -07:00
README.md chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
tsconfig.json chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00
vite.config.ts chore(refs): sync Alchemy reference to beta.76 (#10654) 2026-09-07 21:54:45 -07:00

AWS Website: SvelteKit

Deploys a SvelteKit app to AWS with AWS.Website.SvelteKit — no svelte.config.js adapter, no CDK.

The resource builds the app with SvelteKit's own Vite pipeline and a wrangler-free in-memory AWS adapter, deploys the server output on a streaming Lambda Function URL, and serves client assets + prerendered pages from S3 behind CloudFront. Values passed via env are exposed to server routes through process.env.

const site = yield* AWS.Website.SvelteKit("SvelteKitSite", {
  env: {
    GREETING: "Hello from SvelteKit on AWS!",
  },
});

Commands

bun alchemy deploy   # build + deploy
bun alchemy dev      # SvelteKit's Vite dev server (Node SSR, HMR)
bun alchemy destroy  # tear down

Notes

  • @alchemy.run/frontend-frameworks must be installed in the project — the server's source provider is loaded from its /sveltekit export at deploy time.
  • Unchanged projects skip the build and deploy entirely (the project tree is content-hashed, respecting .gitignore).
  • In alchemy dev, the site is kit's own Vite dev server (plain Node SSR) — already the AWS Lambda programming model, process.env included. No cloud resources are created; wrap the site in Alchemy.remote() to deploy the real infrastructure even during dev.