Looks like it’s alphabetical. Maybe Browserify sorts them that way or that’s just how it comes from the OS. It doesn’t really make any difference—those are just the module definitions. Your code, inside those (require, module, exports)
functions, will always run the same no matter what order the modules were defined in.
Here’s a simplified version of what Browserify is doing that may be more clear:
var modules = {
'./app.js': function (require, module, exports) {
require('./one/one.js');
require('./two/two.js');
require('./three/three.js');
},
'./two/two.js': function (require, module, exports) {
console.log('two');
},
'./one/one.js': function (require, module, exports) {
console.log('one');
},
'./three/three.js': function (require, module, exports) {
console.log('three');
}
};
function require (path) {
var module = {exports: {}};
modules[path](require, module, module.exports);
return module.exports;
}
require('./app.js');
Even if you change the order the modules are defined you should always see the same output:
one
two
three