defer-non-critical-third-party-libraries

Defer non-critical third-party libraries with dynamic imports in Next.js.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/ihj04982/my-cursor-settings --skill defer-non-critical-third-party-libraries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defer-non-critical-third-party-libraries
Source: https://github.com/ihj04982/my-cursor-settings/tree/main/skills/defer-non-critical-third-party-libraries
Command: npx skills add https://github.com/ihj04982/my-cursor-settings --skill defer-non-critical-third-party-libraries

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the issue of non-critical third-party libraries, such as analytics and logging tools, blocking the initial bundle load in web applications, thus delaying user interaction.

Core Features & Use Cases

  • Optimized Loading: Implements dynamic imports to load non-essential scripts after the initial page hydration.
  • Improved Performance: Enhances initial page load times by deferring the execution of non-critical code.
  • Use Case: In a Next.js application, you can use this Skill to ensure that analytics scripts are loaded only after the main content is rendered, improving perceived performance for the end-user.

Quick Start

Use the defer-non-critical-third-party-libraries skill to dynamically import the analytics component in your Next.js application.

Frequently Asked Questions about defer-non-critical-third-party-libraries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I defer non-critical third-party libraries in Next.js to improve initial bundle load times?

You can defer non-critical third-party libraries by using dynamic imports to load scripts after initial page hydration. This delays non-essential code execution until after the main content renders, improving initial page load times.

Why does my Next.js initial bundle load slowly when including analytics scripts?

Your initial bundle loads slowly because non-critical third-party libraries block the initial load. Deferring these scripts via dynamic imports after hydration prevents them from delaying user interaction and improves perceived performance.

What is the best way to load analytics scripts after hydration in a frontend framework?

The best way to load analytics scripts after hydration is implementing dynamic imports for non-essential third-party libraries. This defers execution of non-critical code until after the main content renders, optimizing web application performance.

Can I use dynamic imports to optimize web application performance for non-essential scripts?

Yes, you can use dynamic imports to optimize web application performance by loading non-essential scripts after hydration. This prevents non-critical third-party libraries from blocking the initial bundle load and delaying user interaction.

Does deferring third-party libraries work with Next.js dynamic imports?

Yes, deferring third-party libraries works with Next.js dynamic imports. This mechanism loads non-essential scripts after hydration, ensuring a faster user experience by improving initial bundle load times.