๐ Svelte DevContainer Template for DevPods
A GitHub template repository providing a pre-configured development container for building Svelte applications using DevPods. This template gives you a complete, production-ready development environment with zero configuration. ๐
๐ค Why Use This Template?
โก Quick Start Benefits
- โฑ๏ธ Zero Configuration: Start coding immediately without spending hours setting up your environment
- ๐ฏ Consistent Environment: Every developer gets the same tools, versions, and settings
- ๐ฆ Isolated Development: Your Svelte projects run in containers, keeping your local machine clean
- ๐ ๏ธ Pre-configured Tools: Svelte tooling, linting, formatting, and AI assistance ready out of the box
- โ๏ธ DevPods Ready: Optimized for use with DevPods for seamless cloud and local development
๐ก Perfect For
- ๐ Starting new Svelte projects quickly
- ๐ฅ Team projects requiring consistent development environments
- ๐ Learning Svelte without environment setup hassles
- ๐งช Prototyping and experimentation
- ๐ Teaching and workshops
๐ How to Use This Template
Option 1: Create a New Repository from Template (Recommended) โญ
- Click the "Use this template" button at the top of this repository ๐ฑ๏ธ
- Choose "Create a new repository" โ
- Name your repository and set visibility (public/private) ๐
- Click "Create repository" โ
- Clone your new repository locally ๐ป
- Open in DevPods or VS Code with Dev Containers extension ๐ฏ
Option 2: Use with DevPods Directly ๐ณ
If you have DevPods installed:
devpod up https://github.com/YOUR-USERNAME/YOUR-REPO-NAME
Replace YOUR-USERNAME/YOUR-REPO-NAME with your repository details after creating from the template.
Option 3: Clone and Customize ๐ง
git clone https://github.com/chrispy2day/svelte-dev.git my-svelte-project
cd my-svelte-project
rm -rf .git
git init
# Open in DevPods or VS Code
๐ฆ What's Included
- ๐ณ Base Image:
ghcr.io/devcontainers/templates/javascript-node:4.0.2
- โก Node.js: Latest LTS version
- ๐ฆ Package Manager: npm (auto-updated on container creation)
- ๐ฏ Degit: Pre-installed for scaffolding Svelte projects
๐ VS Code Extensions
The devcontainer automatically installs:
- ๐ฅ Svelte for VS Code - Syntax highlighting, intellisense, and formatting for Svelte
- โ
ESLint - JavaScript/TypeScript linting
- ๐
Prettier - Code formatting
- ๐ค Claude Code - AI-powered coding assistant with Context7 MCP server integration
โ๏ธ Editor Settings
- โจ Format on save enabled
- ๐จ Svelte files use the Svelte formatter
- ๐ง Claude Code pre-configured with Context7 for intelligent documentation lookup
๐ Getting Started
๐ฌ First Time Setup
After creating your repository from this template:
๐ณ Open in DevPods (or VS Code with Dev Containers extension)
- DevPods will automatically detect the devcontainer configuration
- The container will build and start automatically
- Wait for initialization to complete โณ
โ
Verify Your Environment
node --version
npm --version
๐จ Start Building Your Svelte App (see options below)
๐ฏ Creating a New Svelte App
Once inside the devcontainer, you can create a new Svelte app using one of these methods:
Option 1: Using Vite (Recommended) โก
npm create vite@latest my-app -- --template svelte
cd my-app
npm install
npm run dev
Option 2: Using SvelteKit ๐๏ธ
npm create svelte@latest my-app
cd my-app
npm install
npm run dev
Option 3: Using Degit ๐
degit sveltejs/template my-app
cd my-app
npm install
npm run dev
๐ Accessing Your App
The devcontainer forwards port 5173 (Vite's default dev server port). Once your dev server is running, you can access your app at http://localhost:5173. ๐
โ๏ธ Devcontainer Configuration
The devcontainer configuration consists of:
๐จ Customization
๐ Adding More Extensions
Edit .devcontainer/devcontainer.json and add extension IDs to the extensions array:
"extensions": [
"svelte.svelte-vscode",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"your.extension-id"
]
๐ฆ Adding Node Packages Globally
Edit .devcontainer/Dockerfile and add RUN commands:
RUN npm install -g your-package-name
๐ Forwarding Additional Ports
Edit .devcontainer/devcontainer.json and add ports to the forwardPorts array:
"forwardPorts": [5173, 3000, 8080]
๐ง Troubleshooting
๐ซ Port Already in Use
If port 5173 is already in use, you can specify a different port when starting the dev server:
npm run dev -- --port 3000
Make sure to add the new port to forwardPorts in devcontainer.json.
โ Extensions Not Loading
If VS Code extensions don't load automatically, rebuild the container:
- Open the command palette (Cmd/Ctrl + Shift + P) โจ๏ธ
- Select "Dev Containers: Rebuild Container" ๐
๐ License
This devcontainer configuration is provided as-is for development purposes. ๐