Skip to main content

bundle-dynamic-imports

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.

Source facts

Repository
TheOrcDev/8bitcn-ui
Last source activity
January 16, 2026 at 09:09
Detected SKILL.md language
English
Stars
2,050
Forks
121

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
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} /> } ```
View on GitHub