code-splitting
What it does
This skill checks whether heavy scripts load on every page even when they are needed only sometimes. It is for developers building single page apps who want faster first loads.
When to use it
- ✓When a web app's JavaScript bundle is large and slow to start.
- ✓When a chart, editor or other heavy library loads on pages that never use it.
- ✓When you add a new dependency that could be loaded later.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/code-splitting/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My app loads a big chart library on every page. Split it so it loads only where charts appear.”
5 new skills a week. 1 minute to read.
How it works
The agent converts heavy static imports into dynamic import calls, splits code by route, and adds loading states so the page stays usable while the code arrives.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Split large JavaScript bundles
A 500 KB JavaScript bundle blocks page interactivity for 3–5 seconds on a mid-range mobile device even after the bytes arrive — JS must be parsed and compiled before execution. Code splitting means users only download and parse the code they actually need for the current page, dramatically improving Time to Interactive.
Quick Reference
- Use dynamic import() to load code only when it's actually needed
- Split routes in SPAs so each page loads only its own code
- Lazy-load heavy third-party libraries (chart libraries, rich text editors)
- Analyze your bundle with a visualizer to find what to split
Check
Identify any large third-party imports or feature modules in this file that could be loaded lazily with dynamic import() instead of statically.
Fix
Convert the identified static imports to dynamic imports using import() and add appropriate loading states.
Explain
Explain JavaScript code splitting, how dynamic import() works, and how to implement route-based splitting in a SPA.
Code Review
Inspect route modules, heavy feature imports, and third-party libraries loaded on initial render. Flag dependencies that can move behind import(), route boundaries, or user-triggered flows without breaking the first meaningful paint.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/code-splitting
FAQ
What does a dynamic import do?
The skill says it loads code only when it is actually needed, instead of at the start.
What should be split first?
Route-based pieces and heavy third-party libraries, such as chart libraries or rich text editors.
How can I see what to split?
The skill suggests analyzing the bundle with a visualizer tool.
Details
Original description by the author
Use when reviewing large SPA bundles, new dependency additions, or routes that feel slow to hydrate. Focus on code that is not required for the initial view and can move behind route transitions, user interaction, or viewport-based loading.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2774
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.