Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude using patterns #654

Closed
benjamine opened this issue Feb 14, 2014 · 5 comments
Closed

exclude using patterns #654

benjamine opened this issue Feb 14, 2014 · 5 comments

Comments

@benjamine
Copy link

this is a feature request,
I want to exclude from my bundle all files in /vendor or /external
so instead of indicating the files individually I would like to specify a pattern, eg: "/vendor/*"

@ghost
Copy link

ghost commented Feb 14, 2014

I was going to just say "use your shell" but this is actually tricky and messy to do:

browserify z.js `ls -1 vendor|sed 's/^/-u .\/vendor\//'`

@ghost
Copy link

ghost commented Feb 15, 2014

in 3.30.0 you can do:

browserify z.js -u 'vendor/*.js'

@ghost ghost closed this as completed Feb 15, 2014
@benjamine
Copy link
Author

sorry but actually I use browserify thru gulp-browserify, ie. thru it's programmatic api,

    // this works
    browserify({
        standalone: "mylib",
        exclude: "../../vendor/jquery"
    })
    // this doesn't
    browserify({
        standalone: "mylib",
        exclude: "../../vendor/*"
    })

looking at your commits I think you implemented it for the command line argument only.
if I'm not wrong though, I think you'll suggest me to expand the list of files on my code before invoking browserify?

    // this works
    browserify({
        standalone: "mylib",
        exclude: expandGlob("../../vendor/*").andRemoveExtensions()
    })

@ghost
Copy link

ghost commented Feb 15, 2014

You can glob.sync() the arguments yourself from the API, yes. I don't control what gulp does.

@benjamine
Copy link
Author

sure, just thought it could be nicer if exclude accepted something else, a regex or a filter function, but KISS 👍 thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant