Skip to content
Back to skills

Stackblitz Local Dev Loop

ASecurity

'Configure local development for WebContainer applications with hot reload

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
testingtypescriptbashtestingapi

Works with

  • claude code
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned November 11, 2026

npx -y skills add pauldx/claudifying --skill stackblitz-local-dev-loop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stackblitz Local Dev Loop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stackblitz Local Dev Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pauldx-stackblitz-local-dev-loop/badge)](https://www.skillsdirectory.com/skills/pauldx-stackblitz-local-dev-loop)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stackblitz-local-dev-loop
description: '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".

  '
allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(npx:*), Grep
version: 1.0.0
license: MIT
tags:
- saas
- ide
- webcontainers
- stackblitz
compatibility: Designed for Claude Code
---
# 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++) {
      if (!current[parts[i]]) current[parts[i]] = { directory: {} };
      current = current[parts[i]].directory;
    }
    current[parts[parts.length - 1]] = { file: { contents } };
  }
  return tree;
}
```

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| COOP/COEP errors | Missing headers | Add to vite.config.ts |
| `SharedArrayBuffer` undefined | Not cross-origin isolated | Check response headers |
| Test failures | WebContainer needs browser | Use Playwright for integration |

## Resources

- [Vite Config](https://vitejs.dev/config/)
- [WebContainer Guides](https://webcontainers.io/guides/introduction)

## Next Steps

Proceed to `stackblitz-sdk-patterns` for production patterns.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.