stackblitz-local-dev-loop

Featured

Configure local development for WebContainer applications with hot reload and testing. Use when building browser-based IDEs, testing WebContainer file operations, or setting up development workflows for WebContainer projects. Trigger: "stackblitz dev setup", "webcontainer local", "test webcontainers locally".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# StackBlitz Local Dev Loop ## Overview Set up a Vite-based development environment for WebContainer applications with cross-origin headers, hot module replacement, and Vitest for testing file system operations. ## Instructions ### Step 1: Vite Project with WebContainers ```bash npm create vite@latest wc-app -- --template vanilla-ts cd wc-app npm install @webcontainer/api ``` ### Step 2: Configure Vite Headers ```typescript // vite.config.ts import { defineConfig } from 'vite'; export default defineConfig({ server: { headers: { 'Cross-Origin-Embedder-Policy': 'require-corp', 'Cross-Origin-Opener-Policy': 'same-origin', }, }, }); ``` ### Step 3: Test WebContainer Operations ```typescript // tests/webcontainer.test.ts import { describe, it, expect } from 'vitest'; // Note: WebContainer tests require a browser environment // Use Playwright for full integration tests describe('FileSystemTree Builder', () => { it('creates valid tree from flat paths', () => { const tree = buildFileTree({ 'src/index.ts': 'console.log("hello")', 'package.json': '{"name":"test"}', }); expect(tree['package.json']).toHaveProperty('file'); expect(tree.src).toHaveProperty('directory'); }); }); function buildFileTree(flatFiles: Record<string, string>) { const tree: any = {}; for (const [path, contents] of Object.entries(flatFiles)) { const parts = path.split('/'); let current = tree; for (let i = 0; i < parts.length - 1; i+...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category