generator-gulp-angular icon indicating copy to clipboard operation
generator-gulp-angular copied to clipboard

How to use bower components in a custom way (now implement them automatically)?

Open valeriosillari opened this issue 8 years ago • 1 comments

Maybe a silly question, but I am starting from scratch, so ... :)

I would like to add and download some bower components but NOT adding them automatically to the app.

simple example: I want to use only some sass files from bootstrap. right now bower download all the bootstrap-sass-official package (and this is ok), but I want to use only some of the sass files, maybe setting them manually in my stylesheet files. But it seems the the app automatically use them all. where I can edit or set custom option for loading only what I need? Gulp files maybe? bower files? no idea. just say to the app: "download files via bower, put them in a folder and then stop, not use it automatically."

please if anyone could help me or give me some tips it would be nice :)

valeriosillari avatar Apr 10 '16 12:04 valeriosillari

Hi Valerio, use overrides in your bower.json

example using bootstrap official package: main section of bower.json in bootstrap package is:

...
  "main": [
    "less/bootstrap.less",
    "dist/js/bootstrap.js"
  ],
...

i dont want less file but css file... in my bower.json i used these overrides

...
  "overrides": {
    "bootstrap": {
      "main": [
        "dist/css/bootstrap.css",
        "dist/js/bootstrap.js"
      ]
    },
  },
...

other info on overrides be found here: https://github.com/ck86/main-bower-files#overrides-options

cyberdemon8 avatar Apr 27 '16 15:04 cyberdemon8