curist / grunt-bower

grunt task to copy bower installed packages to other folder(s)
MIT License
93 stars 27 forks source link

Avoid renaming files #34

Closed conan closed 10 years ago

conan commented 10 years ago

Currently, grunt-bower renames files to the name of the package. For example, ui-bootstrap-tpls.js, which is in the angular-bootstrap package, gets renamed to angular-bootstrap.js.

It's here: https://github.com/curist/grunt-bower/blob/master/tasks/bower.js#L93

I'm generating my script tags based on the main property from the bower.json of each of my dependencies, which references the name of the file; the rename breaks this. It'd be great to have an option to leave the filename as is.

curist commented 10 years ago

There are many bower components doesn't play nice with the eco system, things like missing bower.json, missing main property, main property pointing to nowhere, etc. So using the packages' name as the copied file name is necessary.

I believe you can workaround the current issue with the packageSpecific option:

'angular-bootstrap': {
  files: [
    'ui-bootstrap-tpls.js'
  ]
}

Yea, I know that kinda sucks. But since we are working with the bower components, sometimes we just gotta get our hands dirty.

conan commented 10 years ago

Hmm, yeah, that's what I've done. I'm generally trying to minimise the amount of overrides I have to specify, and I guess adding an option not to rename an individual dependency is no better than just overriding that dependency, so I take your point!