How do I configure my Gruntfile to run the build scripts for my bower components?
One issue is that each component may have a different build command, for example D3 uses a Makefile, so I need to run make, and angular.js also uses grunt and needs to run grunt build.
Can someone point me to an example of this?
Bower components should be built.
Otherwise users are going to be in the exact situation you're in. I know many components currently aren't, but there's not much we can do about it.
You can use grunt-shell to easily execute whatever build scripts you need to:
grunt.initConfig({
shell: {
d3: {
command: 'make',
options: {
execOptions: {
cwd: 'components/d3'
}
}
},
angular: {
command: 'grunt',
options: {
execOptions: {
cwd: 'components/angular'
}
}
}
}
});
I have been using Grunt Task for Bower to do the build.
You may find it useful.
After setup, you can copy all the required components in this way
grunt bower:install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With