deepak1556 / gulp-browserify

Bundle modules with BrowserifyJS
MIT License
195 stars 45 forks source link

ignore do not support the relative path #85

Open alexsunxl opened 8 years ago

alexsunxl commented 8 years ago

Dear,
I find that this ignore options do not support the relative path. My gulpfile.js code like this:

gulp.task('test', function(){
    return gulp.src('script/modal.js')
        .pipe(browserify({
            //ignore: [./script/jquery.js]     //relative path.  it is invalid!!
            ignore: [require.resolve('./script/jquery.js')] // I need to write like this way 
        }))
        .pipe(gulp.dest('./dist'));
  });

I think it can be write in the source, so that the options can support relative path also such as

    [
      'exclude',
      'add',
      'external',
      'transform',
      'ignore',
      'require'
    ].forEach( function(method) {
      if (!opts[method]) return;
      [].concat(opts[method]).forEach(function (args) {
        //here args  dispose to a absolute path first.
        bundler[method].apply(bundler, [].concat(args));
      });
    });

Thanks for you time : )