Comments (5)
as far as I know, yes, bowerrc can config where we want our packages installed, but Bower installs the whole package.
say, bower install underscore
, we will get 31 files, but what we really need is only underscore.js
.
and that's where this little plugin comes in handy
from grunt-bower.
Makes sense, but maybe this should be renamed, as bower is relatively easy to implement as grunt tasks and this task doesn't expose any of the API.
from grunt-bower.
After a quick reevaluation, I can't really see which/why Bower's API to expose might be useful.
Bower's commands are for one shot thing, excute, and done, I don't think any of the commands will be suitable in a grunt automated task.
But that's only my opinion, would you mind to come up a reason or two which/why Bower's API could be useful if it's exposed?
I'd admit that, this task could be misleading for what it actually does. If there are any better use case for a task named grunt-bower
, changing this task's name sure be a good idea.
from grunt-bower.
Yeoman and a tool I am working on Grunt-Enyo expose bower through their CLI and both do it through a grunt task. Also, I believe that being able to call grunt.task.run() inside of other tasks to kick off a bower task is better than shelling out or having to implement the API each time it is needed.
from grunt-bower.
// bower command wrapper
function bower_wrapper(cmd, done) {
// pull in the bower command module
var command = bower.commands[cmd];
// run
command.line(process.argv)
.on('error', grunt.fatal.bind(grunt.fail))
.on('data', grunt.log.writeln.bind(grunt.log))
.on('end', function(){
done();
});
}
// register bower commands as grunt tasks
Object.keys(bower.commands).forEach(function(cmd) {
var task_name = 'bower:' + cmd
, task_desc = 'wrapped bower ' + cmd + 'command.';
grunt.registerTask(task_name, task_desc, function() {
var done = this.async();
bower_wrapper(cmd, done);
});
});
Modified from Yeoman's bower task, Bower's commands wrapped as Grunt tasks, with < 30 LOC.
It may be convenient to have these API when working on a framework like Yeoman and Grunt-Enyo, but, just look around other grunt tasks, I don't think this is the way a grunt task should be.
Sure I can plug-in the above codes, but it just doesn't feel right.
from grunt-bower.
Related Issues (20)
- Unable to maintain folder structure from root of package directory HOT 11
- expand: false seems broken 0.14.2 upwards HOT 2
- Problems with relative paths for packages with single files HOT 2
- Version 0.15.1+ no longer works in SailsJS HOT 3
- bootstrap.less import problem
- Windows path not supported
- dest not working (windows) HOT 1
- Copying packages defined in `packageSpecific` fails silently
- ignorePackages should allow for typical regex
- Let also *.min.js and *.min.js.map files be copied by default (configurable by option) HOT 3
- images_dest HOT 3
- Ignore devDependencies HOT 1
- Specify bower location HOT 1
- Add option to *only* include certain packages HOT 1
- [filetype]_dest options ignored after upgrading to 0.21.1 HOT 1
- override the .local directory HOT 2
- Problem with graceful-fs HOT 3
- jquery-validation doesn't get copied HOT 4
- Add support for Files Array Format in packageSpecific.files to Allow for Additional Single Package Flexibility
- font-awesome font folder not copying over
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-bower.