Skip to content

Instantly share code, notes, and snippets.

@jcemer
Created July 8, 2014 19:09
Show Gist options
  • Save jcemer/b52db6503eebc42a414d to your computer and use it in GitHub Desktop.
Save jcemer/b52db6503eebc42a414d to your computer and use it in GitHub Desktop.
Browserify sample
module.exports = function (a, b) {
return a + b;
};
// $ browserify main.js -o bundle.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = function (a, b) {
return a + b;
};
},{}],2:[function(require,module,exports){
var add = require('./add');
module.exports = function (a) {
return add(2, a);
};
},{"./add":1}]},{},[2])
var add = require('./add');
module.exports = function (a) {
return add(2, a);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment