·bundle-barrel-imports
*

bundle-barrel-imports

theorcdev/8bitcn-ui

直接從源文件而不是桶文件導入。在使用 lucide-react、@mui/material 或 @radix-ui/react-* 等庫時應用,以減少包大小並縮短開發啟動時間。

18安裝·1熱度·@theorcdev

安裝

$npx skills add https://github.com/theorcdev/8bitcn-ui --skill bundle-barrel-imports

SKILL.md

Import directly from source files instead of barrel files to avoid loading thousands of unused modules. Barrel files are entry points that re-export multiple modules (e.g., index.js that does export from './module').

Popular icon and component libraries can have up to 10,000 re-exports in their entry file. For many React packages, it takes 200-800ms just to import them, affecting both development speed and production cold starts.

Why tree-shaking doesn't help: When a library is marked as external (not bundled), the bundler can't optimize it. If you bundle it to enable tree-shaking, builds become substantially slower analyzing the entire module graph.

直接從源文件而不是桶文件導入。在使用 lucide-react、@mui/material 或 @radix-ui/react-* 等庫時應用,以減少包大小並縮短開發啟動時間。 來源:theorcdev/8bitcn-ui。

查看原文

可引用資訊

為搜尋與 AI 引用準備的穩定欄位與指令。

安裝指令
npx skills add https://github.com/theorcdev/8bitcn-ui --skill bundle-barrel-imports
分類
*創意媒體
認證
收錄時間
2026-02-01
更新時間
2026-02-18

快速解答

什麼是 bundle-barrel-imports?

直接從源文件而不是桶文件導入。在使用 lucide-react、@mui/material 或 @radix-ui/react-* 等庫時應用,以減少包大小並縮短開發啟動時間。 來源:theorcdev/8bitcn-ui。

如何安裝 bundle-barrel-imports?

開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/theorcdev/8bitcn-ui --skill bundle-barrel-imports 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code 或 Cursor 中使用

這個 Skill 的原始碼在哪?

https://github.com/theorcdev/8bitcn-ui