svelte-deployment

Guide Svelte deployment with adapter selection and Vite configuration.

Updated Dec 15, 2025
One-click install
npx skills add https://github.com/spences10/claudefiles --skill svelte-deployment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svelte-deployment
Source: https://github.com/spences10/claudefiles/tree/main/skills/svelte-deployment
Command: npx skills add https://github.com/spences10/claudefiles --skill svelte-deployment

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Guides deployment practices, adapters, and tooling for producing production-ready Svelte apps.

Core Features & Use Cases

  • Adapters: Choosing and installing server/static adapters.
  • Tooling: Vite/PnPM integration guidelines.
  • Library publishing: Guidance for packaging Svelte libraries.

Quick Start

Install a static adapter and add a basic prepare script for SvelteKit project.

Frequently Asked Questions about svelte-deployment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right SvelteKit adapter for my deployment target?

SvelteKit adapters handle deployment to different platforms: static sites, Node servers, and Cloudflare Workers. Select based on your hosting environment—static adapters for CDNs, Node adapters for traditional servers, Cloudflare adapters for edge computing. Each requires specific configuration in svelte.config.js.

What's the correct way to set up pnpm with Vite in a SvelteKit project?

Install pnpm as your package manager, then configure Vite optimization settings in svelte.config.js to handle dependency pre-bundling. Define peerDependencies and keywords in package.json to ensure correct resolution across your project and any libraries you publish.

How do I publish a Svelte library with proper dependency management?

Package your Svelte library by defining peerDependencies for Svelte and runtime dependencies in package.json, adding relevant keywords for discoverability, and configuring bundling strategy in your build scripts. Include a prepare script to generate distribution files before publishing.

Can I add PWA capabilities and offline support to my SvelteKit deployment?

Yes. SvelteKit adapters support service worker integration for offline functionality and progressive enhancement. Configure your adapter and build scripts to generate service workers and enable streaming or offline-first capabilities depending on your target platform.

What package.json scripts do I need for a production SvelteKit build?

Include build, preview, and prepare scripts in package.json. The build script compiles your Svelte app with the selected adapter, preview runs the production build locally, and prepare handles library packaging tasks before deployment or publication.

Does Vite configuration differ between static and server SvelteKit deployments?

Yes. Static deployments precompile all routes at build time with minimal runtime overhead, while server adapters configure Vite for streaming responses and dynamic rendering. Both use svelte.config.js, but optimizer settings, dependency handling, and entry points vary by adapter.