From stackblitz-pack
Documents WebContainer limits on memory, CPU, FS size, processes and supplies TypeScript optimization code for StackBlitz SDK usage.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin stackblitz-packThis skill is limited to using the following tools:
WebContainer resource limits: memory, CPU, file system size, process count.
Optimizes WebContainer boot time, file system mounts, and process spawning for StackBlitz SDK and WebContainers projects.
Optimizes Replit apps for faster cold starts, lower memory usage, efficient Nix caching, and quicker deployments via code tweaks, minimal deps, and config changes.
Enables secure execution of untrusted Python/Node.js code, git operations, and scripts in persistent Linux containers on Cloudflare edge using Workers SDK.
Share bugs, ideas, or general feedback.
WebContainer resource limits: memory, CPU, file system size, process count.
| Resource | Limit | Notes |
|---|---|---|
| Memory | ~2GB | Shared with browser tab |
| File system | Ephemeral, in-memory | Lost on page refresh |
| Processes | Multiple concurrent | Each consumes memory |
| Network | HTTP only | No raw TCP/UDP sockets |
| npm packages | Most work | Native addons not supported |
// Monitor memory usage inside WebContainer
const proc = await wc.spawn('node', ['-e', `
setInterval(() => {
const mem = process.memoryUsage();
const mbUsed = Math.round(mem.heapUsed / 1024 / 1024);
if (mbUsed > 500) console.warn('High memory: ' + mbUsed + 'MB');
}, 5000);
`]);
// Mount only essential files -- skip test files, docs, etc.
const productionFiles: FileSystemTree = {
'package.json': { file: { contents: minimalPackageJson } },
src: { directory: { /* only source files */ } },
// Skip: tests/, docs/, .git/, large assets
};
await wc.mount(productionFiles);
| Issue | Cause | Solution |
|---|---|---|
| Tab crashes | OOM | Reduce mounted files, fewer deps |
| Slow npm install | Large deps | Use --prefer-offline, fewer packages |
| Process killed | Memory limit | Monitor with memoryUsage() |
For security, see stackblitz-security-basics.