svelte-adapter-azure-functions Svelte Themes

Svelte Adapter Azure Functions

Svelt adapter for Azure Function Apps

@shellicar/svelte-adapter-azure-functions

A SvelteKit adapter that builds your app into an Azure Function.

Motivation

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.

Implementation

The adapter generates a single Azure Function:

app.http('server', {
  handler,
  route: '{*url}',
  methods: ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT']
});

Usage

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()
  }
};

Configuration

esbuildOptions

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
};

Credits

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes