如何让凉亭建立包装? [英] How make bower build the package?

查看:141
本文介绍了如何让凉亭建立包装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有办法让bower在GitHub克隆后运行一个软件包grunt?我试图使用Bower,但是其中的一个软件包' m使用的是Bootstrap扩展,x可编辑。
问题在于,当其他软件包将完全构建的版本推送到github时,所以当由Bower安装时,您有一个内置版本x-editable,期望您运行grunt文件来构建软件包。



在npm等其他包管理器中这是一种常见的做法,但我可以找到如何让Bower在安装时进行构建。这意味着我需要另一种机制来完成软件包的安装。

解决方案

建立在安装上是一种反模式,强烈建议在Node中禁止。像Node一样,Bower软件包应该是预先构建的。这是因为最终用户不必关心包需要什么样的预处理器或构建系统。



您最好的选择是要说服作者预先安装,构建,分叉和自己动手,或者在安装组件后手动构建。



Bower团队计划添加将软件包发布到类似服务器的能力以及它如何在npm中工作。这对于需要构建步骤的包来说会更好。


Is there a way to make bower run a package grunt after it was cloned from GitHub?

I'm trying to use Bower but one of the packages I'm using is the Bootstrap extension, x-editable. The problem is that while other packages push a fully built version to github so when installed by Bower you have a built version x-editable expect you to run a grunt file to build the package.

That is a common practice in other package managers like npm but I could find how to make Bower build it on install. Which means I need another mechanism to complete the installation of the package.

解决方案

Building on install is an anti-pattern and is strongly recommended against in Node. Like Node, Bower packages should be pre-built. This is because the end-user shouldn't have to care what preprocessor or build-system a package requires.

Your best options are to either convince the author to pre-build, fork and do it yourself, or build manually after you've installed the component.

The Bower team is planning to add the ability to publish packages to a server similar to how it works in npm. This will make it much better for packages needing a build-step.

这篇关于如何让凉亭建立包装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆