svelte-dev Svelte Themes

Svelte Dev

A dev container environment for creating Svelte apps

๐Ÿš€ 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

  1. Click the "Use this template" button at the top of this repository ๐Ÿ–ฑ๏ธ
  2. Choose "Create a new repository" โž•
  3. Name your repository and set visibility (public/private) ๐Ÿ“
  4. Click "Create repository" โœ…
  5. Clone your new repository locally ๐Ÿ’ป
  6. 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:

  1. ๐Ÿณ 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 โณ
  2. โœ… Verify Your Environment

    node --version
    npm --version
    
  3. ๐ŸŽจ 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:

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:

  1. Open the command palette (Cmd/Ctrl + Shift + P) โŒจ๏ธ
  2. Select "Dev Containers: Rebuild Container" ๐Ÿ”„

๐Ÿ“„ License

This devcontainer configuration is provided as-is for development purposes. ๐Ÿ’™

Top categories

Loading Svelte Themes