如何配置我的Gruntfile
以运行我的bower
组件的构建脚本?使用grunt构建凉亭组件
的一个问题是,每个组件可以有不同的build命令,例如D3使用Makefile
,所以我需要运行make
,并angular.js也使用呻吟,需要运行grunt build
。
有人可以指点我的一个例子吗?
如何配置我的Gruntfile
以运行我的bower
组件的构建脚本?使用grunt构建凉亭组件
的一个问题是,每个组件可以有不同的build命令,例如D3使用Makefile
,所以我需要运行make
,并angular.js也使用呻吟,需要运行grunt build
。
有人可以指点我的一个例子吗?
鲍尔组件应该建立。
否则,用户将会处于您所处的确切位置。我知道很多组件目前都不是,但我们可以做的并不多。
您可以使用grunt-shell轻松执行您需要的任何构建脚本:
grunt.initConfig({
shell: {
d3: {
command: 'make',
options: {
execOptions: {
cwd: 'components/d3'
}
}
},
angular: {
command: 'grunt',
options: {
execOptions: {
cwd: 'components/angular'
}
}
}
}
});
耶grunt-bower-install是另一个好工具:https://github.com/stephenplusplus/grunt-bower-install –
什么是你想建立?你不能直接使用libs吗? – imjared
我想知道的是运行构件库构建脚本的一般方法。例如,angular.js库需要'grunt build'来创建一个JS库文件。某些组件包含存储库中的构建文件,并且存在包含构建的独立存储库,但我希望从主要来源构建组件的一般方法。 – user1027169