A SvelteKit adapter that builds your app into an Azure Function.
Looking at the available SvelteKit adapters, there's one for Node.js and a community adapter for Azure Static Web Apps. I wanted to deploy to Azure Functions, so I created this adapter.
The adapter generates a single Azure Function:
app.http('server', {
handler,
route: '{*url}',
methods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT']
});
pnpm add -D @shellicar/svelte-adapter-azure-functions
In svelte.config.js
:
import adapter from '@shellicar/svelte-adapter-azure-functions';
export default {
kit: {
adapter: adapter()
}
};
adapter({
esbuildOptions: {
minify: false
}
})
Default options in defaults.ts:
export const defaults = {
bundle: true,
platform: 'node',
target: 'node20',
format: 'esm',
// ...see defaults.ts for full options
};