timhc22
timhc22

Reputation: 7451

Gulp Browserify combine JS

I am using Browserify with Gulp to handle external Javascript library requirements.

I want to combine all my non-external libraries into one file as well and can't seem to find any documentation on their site about how to do it (and Googling "browserify bundleConfigs" doesn't seem to come up with anything helpful. This is my current configuration:

browserify: {
    bundleConfigs: [
        {
            entries: SRC + '/javascript/functions.js',
            dest: DEST + '/js/',
            outputName: 'functions.js',
            require: ['jquery', 'backbone/node_modules/underscore', 'backbone']
        }
    ]
}

I also tried:

 entries: [ SRC + '/javascript/functions.js', SRC + 'javascript/menu.js' ]

But that doesn't seem to work either. Has anyone else managed to get this working, or is there a different way I am supposed to be doing this?

Thanks

Upvotes: 1

Views: 261

Answers (1)

timhc22
timhc22

Reputation: 7451

Figured out I could do this with:

require('./myfile'); //not `./myfile.js`

In the base javascript file.

Upvotes: 1

Related Questions