bower-rails icon indicating copy to clipboard operation
bower-rails copied to clipboard

override main_files

Open rstormsf opened this issue 8 years ago • 6 comments

main_files only adds some files, would be great to override it

rstormsf avatar Aug 08 '15 00:08 rstormsf

Have you seen:

# via argument
asset "moment", "2.10.1", main_files: ["./locale/en-gb.js"]

# or in block
asset "moment", "2.10.1" do
  main_files [
    "./locale/en-gb.js",
    "./locale/fr.js",
    "./locale/lv.js"
  ]
end

at Ruby DSL Configuration?

SergeyKishenin avatar Aug 11 '15 10:08 SergeyKishenin

Yes, I have seen this and it doesn't seem like you read what I said. Main_files only adds files to current main object in bower.json For example, if I had something in my main object by default and then I provide via Bowerfile, it doesn't override it, it will keep whatever is already declared in main object and add what I provided. This is inconvenient behaviour.

rstormsf avatar Aug 11 '15 17:08 rstormsf

Well, your issue description is quiet poor, so maybe I missed something. So you want to have an option that will either merge main files declared by you, or override, like

asset "moment", "2.10.1" do
  main_files [ "./locale/lv.js" ], override: true # will keep only ./locale/lv.js file
end

?

SergeyKishenin avatar Aug 11 '15 17:08 SergeyKishenin

I'm sorry if I didn't make it clear at first. Yes, that override: true flag would be great to have. You got the idea right now.

rstormsf avatar Aug 11 '15 20:08 rstormsf

One of the reasons why - is because

  1. when I want to completely ignore package to be installed in bower_components folder, but it will be done because it's dependency of bower package. Things like jquery that I load in rails assets pipeline. 2)Maintainers are frequently include more stuff in main object than needed - and I have no control over those files and I don't want it to be deployed in production since it is in vendor folder

rstormsf avatar Aug 11 '15 20:08 rstormsf

I'll reopen for now until I have more free time or someone provide a PR.

SergeyKishenin avatar Aug 11 '15 21:08 SergeyKishenin