gulp wiredep- ignorePath 不工作

gulp wiredep- ignorePath not working

我的 .bowerrc 有这个 "directory": "./public/bower_components/"

我成功地注入了 html,但是我得到了不需要的路径前缀,'../../public/':

<script src="../../public/bower_components/jquery/dist/jquery.js"></script>
<script src="../../public/bower_components/underscore/underscore.js"></script>
<script src="../../public/bower_components/angular/angular.js"></script>
<script src="../../public/bower_components/typeahead.js/dist/typeahead.bundle.js"></script>
<script src="../../public/bower_components/angular-file-upload-shim/angular-file-upload-shim.js"></script>
<script src="../../public/bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="../../public/bower_components/angular-animate/angular-animate.js"></script>

我的 gulp 任务如下所示:

gulp.task('wiredep', function() {
   var options = config.getWiredepDefaultOptions();
   var wiredep = require('wiredep').stream;

   return gulp
         .src(config.index)
         .pipe(wiredep(options))
         .pipe($.inject(gulp.src(config.clientjs), {ignorePath: '/public/'}))
         .pipe(gulp.dest('./build/'));
});

我的 wiredep 选项如下所示:

  bowerJson: require('./bower.json'),
  directory: './public/bower_components/',
  ignorePath: '../../public/'

根据 wiredep docs,它有一个 ignorePath 选项 属性 我可以传递,将从注入路径中忽略。我找不到问题所在。有什么想法吗?

我的 gulp.config.js 中有错别字,导致我的选项无法正确加载