{"id":13539938,"url":"https://github.com/yarbsemaj/sveltekit-adapter-lambda","last_synced_at":"2025-03-01T11:28:20.082Z","repository":{"id":42456055,"uuid":"410108546","full_name":"yarbsemaj/sveltekit-adapter-lambda","owner":"yarbsemaj","description":"An adapter to build a SvelteKit app into a lambda ready for deployment with lambda proxy via the Serverless Framework or CDK.","archived":false,"fork":false,"pushed_at":"2024-06-12T20:45:16.000Z","size":564,"stargazers_count":79,"open_issues_count":10,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-15T01:04:47.702Z","etag":null,"topics":["aws","aws-lambda","cdk","cloudformation","cloudfront","lambda","serverless","sveltekit","sveltekit-adapter"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@yarbsemaj/adapter-lambda","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yarbsemaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-24T21:39:50.000Z","updated_at":"2024-11-27T01:54:47.000Z","dependencies_parsed_at":"2024-01-16T15:40:32.980Z","dependency_job_id":"60f437a5-fbb3-4582-9482-ee61df640cc2","html_url":"https://github.com/yarbsemaj/sveltekit-adapter-lambda","commit_stats":null,"previous_names":["yarbsemaj/adapter-lambda"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yarbsemaj%2Fsveltekit-adapter-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yarbsemaj%2Fsveltekit-adapter-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yarbsemaj%2Fsveltekit-adapter-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yarbsemaj%2Fsveltekit-adapter-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yarbsemaj","download_url":"https://codeload.github.com/yarbsemaj/sveltekit-adapter-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240729131,"owners_count":19848121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","cdk","cloudformation","cloudfront","lambda","serverless","sveltekit","sveltekit-adapter"],"created_at":"2024-08-01T09:01:34.779Z","updated_at":"2025-03-01T11:28:19.805Z","avatar_url":"https://github.com/yarbsemaj.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Adapters"],"sub_categories":["The _How To's?_"],"readme":"# adapter-lambda for SvelteKit\n\nAn adapter to build a [SvelteKit](https://kit.svelte.dev/) app into a lambda ready for deployment with lambda proxy via the Serverless framework or CDK.\n\n## Installation\n```\nnpm install --save-dev @yarbsemaj/adapter-lambda\n```\n## Usage\n\nIn your `svelte.config.js` configure the adapter as below;\n\n```js\nimport serverless from '@yarbsemaj/adapter-lambda';\nimport { vitePreprocess } from '@sveltejs/vite-plugin-svelte';\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n\tpreprocess: vitePreprocess(),\n\n\tkit: {\n\t\tadapter: serverless() //See Below for optional arguments\n\t}\n};\n\nexport default config;\n```\n\n### For serverless\nCopy `serverless.yml` from the root of this repo to the root of your project, make sure to change the service name.\n\nAfter building your app run `sls deploy` to deploy code to AWS using the build tool [serverless](https://www.serverless.com/).\n\nAn example project using serverless can be found [here](https://github.com/yarbsemaj/sveltekit-serverless-starter).\n\n### For CDK\nCopy `SvelteKitSite.ts` from the root of this repo into your project and add it to a CDK stack.\n\nDeploy your stack using `cdk deploy --all`\n\nAn example project using cdk can be found [here](https://github.com/yarbsemaj/sveltekit-cdk-starter).\n\n### Tada 🎉\nNo matter how you deploy, your app can then be accessed via the CloudFront distribution created as a part of the stack.\n\n## Options\n| Argument            | Description                                | Type    | Default |\n| ------------------- | ------------------------------------------ | ------- | ------- |\n| **out**             | the output directory of build files        | string  | build   |\n| **esbuildOverride** | overrides for the [default esbuild options](https://github.com/yarbsemaj/sveltekit-adapter-lambda/blob/master/index.js#L50)  | [esbuild Build Options](https://github.com/evanw/esbuild/blob/fc37c2fa9de2ad77476a6d4a8f1516196b90187e/lib/shared/types.ts#L110) | {}     |\n\n## Static Assets and precompiled pages\nTo server static assets and precompiled pages, this adapter makes use of S3. In order to route traffic to the correct destination a Lambda@edge function is used to perform an origin rewrite to redirect traffic to the S3 Bucket.\n\n## Infrastructure Diagram\n![Infra](https://github.com/yarbsemaj/sveltekit-adapter-lambda/blob/master/docs/assets/diagram.png?raw=true)\n\n\n## Help! I'm getting an error while building or serving my app.\nPlease raise an issue on [Github](https://github.com/yarbsemaj/sveltekit-adapter-lambda/issues), and I will be happy to issue a fix.\n\n## Versions\n| Adapter Version | Sveltekit Version |\n| --------------- | ----------------- |\n| 1.1.x - 1.2.x   | 1.22.0 (Official) |\n| 1.x.x           | 1.0.0 (Official)  |\n| 0.12.x          | 1.0.0-next.433    |\n| 0.11.x          | 1.0.0-next.401    |\n| 0.10.x          | 1.0.0-next.380    |\n| 0.9.x           | 1.0.0-next.348    |\n| 0.6.x - 0.8.x   | 1.0.0-next.301    |\n| 0.5.x           | 1.0.0-next.286    |\n| 0.3.x - 0.4.x   | 1.0.0-next.286    |\n| 0.2.x           | 1.0.0-next.239    |\n| 0.1.x           | 1.0.0-next.169    |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyarbsemaj%2Fsveltekit-adapter-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyarbsemaj%2Fsveltekit-adapter-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyarbsemaj%2Fsveltekit-adapter-lambda/lists"}