·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