使用componentjs (https://github.com/component/component) 相对于requirejs 有哪些好处?
这两个项目具有相同的思想,很难在它们之间做出选择。
使用componentjs (https://github.com/component/component) 相对于requirejs 有哪些好处?
这两个项目具有相同的思想,很难在它们之间做出选择。
RequireJS 是一个 JavaScript 文件和模块加载器。
Component 是一个完整的系统,可以将 HTML+JS+CSS+图像+字体打包成一个模块(组件)。Component 还提供了包注册表(与 npm 相比)、依赖处理(与 RequireJS 相比)、构建和任务系统(与 grunt/gulp 相比)。
有一份很好的文档将 Component 与其他构建/包处理工具进行了比较: https://github.com/component/guide/blob/master/component/vs.md
这篇博客帮助我理解了 Component:http://blog.benmcmahen.com/post/55280740882/using-component-js