Releases: geoffrich/svelte-adapter-azure-swa
svelte-adapter-azure-swa v0.20.1
svelte-adapter-azure-swa v0.20.0
This version includes breaking changes in required dependencies:
- Require SvelteKit version 2. See the SvelteKit v2 migration guide first to handle any SvelteKit breaking changes.
- Require Node 18 or higher. If you previously set
platform.apiRuntime
tonode:18
in the customStaticWebAppConfig, you can remove this setting. - Use esbuild 0.19.9 to build the deployed Azure function for SSR
IMPORTANT: since Azure's build system still defaults to Node 16 to build your app, you may need to set the engines field in your package.json to force it to build with Node 18. Node 16 is EOL and is not supported by SvelteKit v2.
Features
- require SvelteKit 2 and Node 18 (c77c842)
svelte-adapter-azure-swa v0.19.1
svelte-adapter-azure-swa v0.19.0
svelte-adapter-azure-swa v0.18.0
svelte-adapter-azure-swa v0.17.0
This release contains two (likely non-breaking) features.
Allow customizing the node version
In production, your SvelteKit app will run a Node Azure Function to handle server requests. By default, this Azure Function uses Node 16. If you want to customize your Node version (version 18 is in public preview for Azure SWA), you can do so with the customStaticWebAppConfig
adapter option to set platform.apiRuntime
.
// svelte.config.js
import adapter from 'svelte-adapter-azure-swa';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({
customStaticWebAppConfig: {
platform: {
apiRuntime: 'node:18'
}
}
})
}
};
export default config;
Throw an error during build if the app declares /api routes
In production, Azure SWA will handle any request to routes starting with /api
. If you also declare SvelteKit routes starting with /api
, they will not be reachable in production and hitting them returns confusing errors (see #89 and #78 for context).
Because this, the adapter will now throw an error at build time and instruct you to rename the routes. If you do want to allow these routes for some reason, you can set allowReservedSwaRoutes
in your adapter options. However, this will not start routing /api
requests to your SvelteKit app, since SWA does not allow configuring the /api
route.
Features
svelte-adapter-azure-swa v0.16.0
svelte-adapter-azure-swa v0.15.0
svelte-adapter-azure-swa v0.14.0
svelte-adapter-azure-swa v0.13.0
This release bumps the SvelteKit peer dependency to 1.0. If you are on a pre-1.0 version of SvelteKit, you will need to update to use further releases of this adapter.
If you are already on SvelteKit 1.0, you shouldn't need to make any changes to update to this release.
Features
- bump deps to SvelteKit 1.0 (d050933)