deepak1556 / gulp-browserify

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

Add options nobuiltins #63

Closed retrofox closed 10 years ago

retrofox commented 10 years ago

Add a way to ignore builtins from options object.

gulp.task('scripts', function() {
  gulp.src(['src/index.js'])
    .pipe(browserify({
      nobuiltins: 'events querystring'
    }))
    .pipe(gulp.dest('./build/js'))
});
adam-lynch commented 10 years ago

FYI, I can't tell from the readme change what this does. I'm no browserify expert either though. What's a built-in?

deepak1556 commented 10 years ago

Cool, Thanks :+1:

retrofox commented 10 years ago

Thanks very much. @deepak1556 can you add a tag and then publish to npm ? I forgot add it

deepak1556 commented 10 years ago

Done!

retrofox commented 10 years ago

thanks !!!!!

retrofox commented 10 years ago

@deepak1556 please can you publish it ? It still is 0.4.6 https://www.npmjs.org/package/gulp-browserify

deepak1556 commented 10 years ago

i did publish it as v0.5.0, weird!

retrofox commented 10 years ago

:-(

deepak1556 commented 10 years ago

is there a way to check my publish history in npm-cli for a package?

deepak1556 commented 10 years ago

@retrofox its there nw :)

retrofox commented 10 years ago

thanks again !!!

On 7 March 2014 18:45, Robo notifications@github.com wrote:

@retrofox https://github.com/retrofox its there nw :)

Reply to this email directly or view it on GitHubhttps://github.com/deepak1556/gulp-browserify/pull/63#issuecomment-37071148 .

retrofox.com.ar

shuhei commented 10 years ago

What's the use case of this? Builtins that are not used won't be bundled anyway.

deepak1556 commented 10 years ago

@shuhei i imagine a use case where an alternative for a builtin is to be used for ex: component/events. @retrofox could explain a better use case.

TooTallNate commented 10 years ago

@shuhei i imagine a use case where an alternative for a builtin is to be used for ex: component/events

That's exactly our use-case. Thanks for the merge @deepak1556!

deepak1556 commented 10 years ago

:+1:

shuhei commented 10 years ago

@shuhei i imagine a use case where an alternative for a builtin is to be used for ex: component/events

That's exactly our use-case. Thanks for the merge @deepak1556!

Do you mean you want require('events') to return component/events? If so, does this work?

var extend = require('util')._extend;

var builtins = require('browserify/lib/builtins');
var componentEventsPath = require.resolve('component-events');
opts.builtins = extend(extend({}, builtins), { events: componentEventsPath });