TheOrcDev / bundle-dynamic-imports
Install for your project team
Run this command in your project directory to install the skill for your entire team:
mkdir -p .claude/skills/bundle-dynamic-imports && curl -L -o skill.zip "https://fastmcp.me/Skills/Download/3799" && unzip -o skill.zip -d .claude/skills/bundle-dynamic-imports && rm skill.zip
Project Skills
This skill will be saved in .claude/skills/bundle-dynamic-imports/ and checked into git. All team members will have access to it automatically.
Important: Please verify the skill by reviewing its instructions before using it.
Use next/dynamic for lazy-loading heavy components. Apply when importing large components like editors, charts, or rich text editors that aren't needed on initial render.
0 views
0 installs
Skill Content
---
name: bundle-dynamic-imports
description: Use next/dynamic for lazy-loading heavy components. Apply when importing large components like editors, charts, or rich text editors that aren't needed on initial render.
---
## Dynamic Imports for Heavy Components
Use `next/dynamic` to lazy-load large components not needed on initial render.
**Incorrect (Monaco bundles with main chunk ~300KB):**
```tsx
import { MonacoEditor } from './monaco-editor'
function CodePanel({ code }: { code: string }) {
return <MonacoEditor value={code} />
}
```
**Correct (Monaco loads on demand):**
```tsx
import dynamic from 'next/dynamic'
const MonacoEditor = dynamic(
() => import('./monaco-editor').then(m => m.MonacoEditor),
{ ssr: false }
)
function CodePanel({ code }: { code: string }) {
return <MonacoEditor value={code} />
}
```