permanently ignore a dependency with bower

后端 未结 6 1305
太阳男子
太阳男子 2020-12-05 02:11

I am downloading angular, angular-bootstrap and bootstrap with bower. Bootstrap has a dependency on jquery which is installed in the process. But i don\'t need it in my proj

6条回答
  •  醉酒成梦
    2020-12-05 02:27

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

    grunt-bower-install: exclude certain components

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

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

    Bower will still download jquery unfortunately but at least you can tell it not to be included in the HTML src.

提交回复
热议问题