用途:当用户需要用 Rollup 打包库或应用、进行 Tree-shaking、输出多格式(ESM/CJS),或配置 input、output、plugin 与外部依赖时,可使用本技能获取指导。
主要能力:覆盖 Rollup 的配置、插件、代码分割、Tree-shaking 与库打包等主题。
使用方式:配置 rollup.config.js,设置 input、output.format、output.file 或 output.dir,以及 plugins(如 node-resolve、commonjs、terser)。库打包可采用多格式输出;应用可与 Vite 或其他工具配合使用。官方参考:https://rollupjs.org/
最佳实践:库打包时声明 external;保留 sourcemap 便于调试;将大依赖外部化;按需使用 code-splitting。
限制:资料未提供具体版本要求、完整配置示例、性能数据或收费信息,暂未提供。