Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

svelte-adapter-appengine

halfdanj778apache-2.01.2.0TypeScript support: included

Adapter for Svelte that integrates with Google Cloud Appengine

svelte, sveltekit, sveltekit-adapter, appengine

readme

svelte-adapter-appengine

Easily deploy your SvelteKit applications on Google Cloud App Engine with the svelte-adapter-appengine package.

npm Tests SvelteKit

Getting Started

To set up the adapter in your SvelteKit project:

  1. Install the package as a development dependency:
npm install --save-dev svelte-adapter-appengine
  1. Update your svelte.config.js to use the adapter:
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
+import adapter from "svelte-adapter-appengine";

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: vitePreprocess(),

  kit: {
+   adapter: adapter(),
  },
};

export default config;
  1. Build your application:
npm run build
  1. Deploy your application to App Engine:
gcloud app deploy --project <CLOUD_PROJECT_ID> build/app.yaml

Learn more about the gcloud utility in the official documentation

Configuration Options

Customize the adapter behavior using the following options:

adapter({
  // Build output directory (default: `/build`)
  out: "/build",

  // Enable Google Cloud Tracing Agent for improved logging (default: `false`)
  useCloudTracing: false,

  // Enable or disable Google Cloud Logging (default: `false`)
  // See: https://cloud.google.com/logging/docs/overview
  useCloudLogging: false,

  // Specify external modules for the esbuild step
  external: [],

  // Specify Node modules to be added to the `package.json` file in the build step
  // These modules will be fetched when the application is deployed
  dependencies: [],

  // Set the Node.js version for the App Engine runtime (default: `22`)
  // See available runtimes: https://cloud.google.com/appengine/docs/standard/nodejs/runtime
  nodejsRuntime: 22,
});

You can also customize the generated app.yaml file by creating an app.yaml file in your project root. The adapter will merge your custom configuration with the generated app.yaml, allowing you to define custom machine types, routes, or other app.yaml configurations.

Adapter Output

The Server-Side Rendering (SSR) part of SvelteKit is hosted on App Engine using a Node.js runtime, using polka to mimic @sveltejs/adapter-node .

Static files are served directly from Cloud Storage, bypassing the Node.js web server. The adapter automatically generates routes for all static assets in the app.yaml file.

Example Application

Check out a live example application at https://svelte-adapter-demo.uc.r.appspot.com/. This demo app is the default SvelteKit template deployed with the default adapter settings.

changelog

Changelog

1.2.0 (2025-02-24)

Features

  • Change default nodejs runtime to nodejs22 (#217) (9475afc)

1.1.0 (2024-01-01)

Features

1.0.0 (2024-01-01)

Features

Bug Fixes

  • Mark sveltekit 2 as valid peer dependency (#148) (c531361)

Miscellaneous Chores

0.10.3 (2023-05-26)

Bug Fixes

  • Improve error handling with large number of asset routes (#103) (fd58810)

0.10.2 (2023-03-25)

Bug Fixes

  • Handle paths on windows correctly (#90) (b49d982)

0.10.1 (2023-02-05)

Bug Fixes

  • Make cloud tracing optional middleware (#71) (5e98af1)

0.10.0 (2023-02-04)

Features

  • Add option to select GAE nodejs version (#70) (6db2125)
  • Add support for Google Cloud Logging (#67) (0dcc8a7)

Bug Fixes

0.9.3 (2023-01-21)

Bug Fixes

  • Add prerendered assets to app.yaml (#64) (8afbc21)

0.9.2 (2022-10-14)

Bug Fixes

0.9.1 (2022-09-13)

Bug Fixes

  • Correctly read the protocol on localhost (64889fa)
  • Solve multiple issues from sveltekit breaking changes (#52) (450f29d)
  • update getRequest method call (cdf93a2)

0.9.0 (2022-08-26)

Features

  • Return 200 OK from /_ah/start (f5f7e64)

0.8.2 (2022-08-26)

Bug Fixes

  • Add server init (f59b92c), closes #44
  • Modify test to support sveltekit 406 (ef11d09)

0.8.1 (2022-07-19)

Bug Fixes

  • Remove writeStatic from adapter code (534d559)

0.8.0 (2022-07-06)

Features

  • add external adapter option passed though to esbuild (9171055)

0.7.0 (2022-07-05)

Features

  • Change build dir to build to follow conventions (73cbfc7)
  • Only serve immutable files with cache expiration (3bd4960)
  • Update esbuild to include source map (b60f318)

Bug Fixes

  • only set long expiration for files in _app/immutable directory (89bc1c6)
  • Remove compression from serving (08746d4)

0.6.1 (2022-06-15)

Bug Fixes

  • Adjust imports to support sveltekit >= 341 (9fb0b0e)

0.6.0 (2022-03-26)

⚠ BREAKING CHANGES

  • Update to support sveltekit >= 292

Code Refactoring

  • Update to support sveltekit >= 292 (885b03d)

0.5.1 (2022-02-23)

Bug Fixes

0.5.0 (2022-02-23)

⚠ BREAKING CHANGES

  • Refactor to support changes in sveltekit 280

Code Refactoring

  • Refactor to support changes in sveltekit 280 (e3086af)

0.4.0 (2022-01-20)

Features

  • Add support for custom app.yaml file. Fixes #14 (4f2a4d6)

0.3.0 (2022-01-20)

⚠ BREAKING CHANGES

  • Make changes to support new request format in sveltekit

Code Refactoring

  • Make changes to support new request format in sveltekit (5223c9a)

0.2.1 (2022-01-07)

Bug Fixes

  • Fix issue where some paths where not added to yaml (401ff61)

0.2.0 (2022-01-07)

⚠ BREAKING CHANGES

  • Update adapter to latest sveltekit version.

Code Refactoring

  • Update adapter to latest sveltekit version. (a2fbd3a), closes #5

0.1.1 (2021-11-09)

Bug Fixes

  • Handle paths in windows correctly in app.yaml (77624eb)

0.1.0 (2021-10-20)

Features

  • Correctly handle index.html paths in app.yaml (350fc88)