网络资产的包管理器 [英] A package manager for web assets
问题描述
您知道网络资产的包管理器吗?
我想要一些可以下载库(例如 jQuery)的东西,这样我就可以将它们插入到我的资产管道中.js.* python 包fanstatic 很接近,但他们选择了该库的一个最新"版本,这可能会滞后几个版本.>
Google 的 js cdn 包含其中一些的元数据,但是主要设计为由浏览器直接下载.
我找到了这些用于浏览器 javascript 的包管理器:
- CPM(CommonJS 包管理器),专注于 Dojo 包,存档位于 http://packages.dojofoundation.org/(大约 60 个包).CPM 使用 mappings 字段 扩充了 CommonJS 格式,以描述依赖包中的模块如何可以是 require()d
- Caolan 的 Jam,其存档位于 http://jamjs.org/packages/.这是果酱包装指南.
- Ender 捎带在 npm 用于包管理,并提供一个看起来像 AMD 的客户端(我不确定 AMD 的兼容性,根据错误报告,这取决于每个包).这里是 Ender 打包文档.这里是带有 ender 关键字的包.Ender 并不专注于打包现有的库,尽管它的 Jeesh 入门包是一个模块化的、大部分兼容的 jQuery 替代品.
其中大多数可以以 AMD 格式发布,用于浏览器加载程序,并且可以通过 RequireJS 加载.他们还倾向于为他们的 package.json 使用 CommonJS 包格式(也被 npm 使用)元数据.
我还发现了 XStatic,它似乎是 fanstatic 不太活跃的版本,并且像 fanstatic 将库包装在 Python 包中.它有相同的限制(版本往往滞后),但编写包装器包似乎很简单,我可以烘焙自己的更新.
BPM 和 fanstatic 知道非 js 资产并且可以合并或缩小 CSS.
Do you know a package manager for web assets?
I'd like something that can download libraries such as jQuery so I can plug them into my asset pipeline. The js.* python packages for fanstatic are close, but they pick a single "latest" version of the library, which can lag a few releases behind.
Google's js cdn has the metadata for a few of them, but is mostly designed to be downloaded by the browser directly.
I've found these package managers for in-browser javascript:
- CPM (CommonJS package manager), focused on Dojo packages, with an archive at http://packages.dojofoundation.org/ (about 60 packages). CPM augments the CommonJS format with a mappings field to describe how modules from dependent packages can be require()d
- Caolan's Jam, whose archive is at http://jamjs.org/packages/. Here is the Jam packaging guide.
- Ender piggybacks on npm for package management, and provides a client that looks like AMD (I'm not sure about AMD compatibility, which according to a bug report is left up to each package). Here are the Ender packaging docs. Here are packages with the ender keyword. Ender doesn't focus on packaging existing libraries, though its Jeesh starter pack is a modular, mostly-compatible replacement for jQuery.
Most of these can publish in the AMD format for browser loaders, and can be loaded by RequireJS. They also tend to use the CommonJS package format (also used by npm) for their package.json metadata.
I also found XStatic, which seems to be a less-active version of fanstatic, and like fanstatic wraps the libraries in Python packages. It has the same limitation (versions tend to lag), but writing a wrapper package seems simple enough that I can bake my own updates.
BPM and fanstatic are aware of non-js assets and can merge or minify CSS.
这篇关于网络资产的包管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!