Constantly ignore arbor addiction

I load angular, angular-bootstrap and bootstrap with a gazebo. Bootstrap has a dependency on jquery that is installed in the process. But I do not need this in my project, since I use only bootstrap css.

So, I tried to permanently remove jquery dependency with

bower uninstall jquery --save 

This is a jquery removal, but the next time I do a bower update it will load again.

Is there a way to tell the player to constantly skip an addiction?

edit: I would like something like this:

 "resolutions": { "jquery": "no, thanks" } 
+47
bower
Jan 05 '14 at 20:33
source share
6 answers

Pull request # 1394 added official support for this function and is present in version 1.6.3 and below. Check your version with bower -v and run npm install -g bower to update.

For reference, see .bowerrc . If this does not work for you, indicate a problem with bower , because it is a mistake.

We use it in our .bowerrc , for example:

 { "ignoredDependencies": [ "bootstrap", "bootstrap-sass", "bootstrap-sass-official" ] } 
+67
Jan 6 '15 at 3:22
source share

We had a similar situation where we had a Backbone dependency on Underscore in her bower.json , but instead we use Lo-Dash, so Bower pulled Underscore unnecessarily for each installation. We have automated compliance checks for third-party licenses, so we did not want anything that we really did not use.

I understand that this is not exactly what they are intended for, but Bower install-hooks can be used to clean unnecessary post-prints — install (at least until Bower gets the “thank you” permission for which you hinted). In .bowerrc :

 { "directory": "app/bower_components", "scripts": { "postinstall": "rm -rf app/bower_components/underscore" } } 

It’s a little hack, but it works.

+25
Apr 25 '14 at 9:31
source share

Something you can do in the bower.json file bower.json :

 { "dependencies": { ... "bootstrap": "^3.2.0" } "overrides": { "bootstrap": { "dependencies": [] } } } 

This means: remove all boostrap dependencies, what you need as jquery is the only one (you can check with bower info bootstrap )

+13
Aug 14 '15 at 18:18
source share

Add it to your .gitignore if you commit your dependencies. Otherwise, leave it as it does not matter. You should just use what you need and ignore the rest.

+5
Jan 6 '14 at 0:29
source share

The above answers are correct, but an additional solution is to use wiredep as described in this answer:

grunt-bower-install: exclude specific components

After installing grunt-wiredep, you can add something similar to this in your Grunt.js to exclude jquery from the insert:

 // Automatically inject Bower components into the app wiredep: { options: {}, app: { src: ['<%= my.app %>/index.html'], exclude: ['bower_components/jquery'] } }, 

Bower will load jquery anyway, but at least you can say that it will not be included in HTML src.

+1
Mar 10 '15 at 19:38
source share

DISCLAIMER: This does not fix your specific problem, but it helped me, so maybe it will help other people.

I use grunt-bower-task to pull files into the lib directory. I wanted to exclude "angular" and just include "angular.js". One of my dependencies was "angular". In my bower.json , I now have:

 { "name": "myapp", "version": "0.0.1", "dependencies": { "angular.js": "1.3.15", "angular-bootstrap": "0.13.0", "angular-cookies": "1.3.15", "angular-storage": "0.5.0", "angular-ui-router": "0.2.15", "mjolnic-bootstrap-colorpicker": "2.1" }, "exportsOverride": { "angular": { "dump": "*.xxx" }, "angular.js": { "js": [ "*.js", "*.js.map" ], "css": "*.css" } }, "resolutions": { "angular": "1.3.15" } } 

In my gruntfile.js , I have:

 bower: { install: { options: { targetDir: './lib', layout: 'byType', install: true, cleanTargetDir: true, cleanBowerDir: false } } }, 

This stops copying the "angular" files to the destination.

+1
Jun 19. '15 at 16:31
source share



All Articles