Toolverse
All skills

bundle-barrel-imports

by TheOrcDev

Import directly from source files instead of barrel files. Apply when using libraries like lucide-react, @mui/material, or @radix-ui/react-* to reduce bundle size and improve dev boot time.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
TheOrcDev
Category
Mobile
Views
1

About this skill

Import directly from source files instead of barrel files. Apply when using libraries like lucide-react, @mui/material, or @radix-ui/react-* to reduce bundle size and improve dev boot time.

How to use

  1. Zainstaluj skill bundle-barrel-imports w swoim projekcie Claude'a, dodając go do katalogu .claude/skills lub konfiguracji agenta.
  2. Zidentyfikuj biblioteki barrel files w swoim kodzie – szukaj importów takich jak import { Check, X } from 'lucide-react' lub import { Button } from '@mui/material'.
  3. Poproś Claude'a o refaktoryzację – opisz problem (wolny dev boot, duży bundle) i wskaż bibliotekę, którą chcesz zoptymalizować.
  4. Claude zaproponuje zmianę na importy bezpośrednie, np. import Check from 'lucide-react/dist/esm/icons/check' zamiast importu z barrel file'a.
  5. Jeśli używasz Next.js 13.5+, rozważ alternatywę – dodaj optimizePackageImports w next.config.js, aby Claude mógł pozostawić ergonomiczne importy, a build tool automatycznie je zoptymalizuje.
  6. Przetestuj aplikację – sprawdź, czy bundle zmniejszył się, a czas startu dev skrócił się o 15–70%.

Related skills