diff --git a/README.md b/README.md
index d4013410..fa04dafd 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,23 @@ A simple, lightweight, no-dependencies JavaScript image lightbox.
* **Bower**: `bower install luminous`
* **Manual**: [Download](https://github.com/imgix/luminous/archive/master.zip) and use `dist/luminous.min.js` or `dist/luminous.js`
-If your build process will re-run `dist/Luminous.js` or `dist/Luminous.min.js` through Browserify, you'll need to add `noParse: ['luminous-lightbox']` to your Browserify config. If you skip this, Browserify will attempt to re-require Luminous' dependencies which have already been inlined.
+If you're using the pre-built version of Luminous, it will automatically make `window.Luminous` and `window.LuminousGallery` available for your use when included on your page.
+
+If you prefer to use `require` statements and a build tool like Browserify, there are a couple other things to keep in mind. First, `require('luminous-lightbox')` gives you an object with `Luminous` and `LuminousGallery` keys. You can use it like this:
+
+``` javascript
+var Luminous = require('luminous-lightbox').Luminous;
+
+new Luminous(…);
+```
+
+If your project uses ES6, you can do the following instead:
+
+``` javascript
+import { Luminous } from 'luminous-lightbox';
+
+new Luminous(…);
+```
diff --git a/dist/Luminous.js b/dist/Luminous.js
index cab2c70e..37ab910f 100644
--- a/dist/Luminous.js
+++ b/dist/Luminous.js
@@ -1,13 +1,27 @@
(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);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;ot;t++){var i=this.triggers[t],n=new r["default"](i,this.luminousOpts);this.luminousInstances.push(n)}}},{key:"nextTrigger",value:function(e){var t=Array.prototype.indexOf.call(this.triggers,e)+1;return t>=this.triggers.length?this.triggers[0]:this.triggers[t]}},{key:"previousTrigger",value:function(e){var t=Array.prototype.indexOf.call(this.triggers,e)-1;return 0>t?this.triggers[this.triggers.length-1]:this.triggers[t]}},{key:"destroy",value:function(){}}]),e}();i["default"]=a},{"./Luminous":2,"./util/dom":6}],4:[function(e,t,i){"use strict";function n(){if(!document.querySelector(".lum-base-styles")){var e=document.createElement("style");e.type="text/css",e.classList.add("lum-base-styles"),e.appendChild(document.createTextNode(s));var t=document.head;t.insertBefore(e,t.firstChild)}}Object.defineProperty(i,"__esModule",{value:!0}),i["default"]=n;var s="\n@keyframes lum-noop {\n 0% { zoom: 1; }\n}\n\n.lum-lightbox {\n position: fixed;\n display: none;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n.lum-lightbox.lum-open {\n display: block;\n}\n\n.lum-lightbox.lum-opening, .lum-lightbox.lum-closing {\n animation: lum-noop 1ms;\n}\n\n.lum-lightbox-inner {\n position: absolute;\n top: 0%;\n right: 0%;\n bottom: 0%;\n left: 0%;\n\n overflow: hidden;\n}\n\n.lum-lightbox-loader {\n display: none;\n}\n\n.lum-lightbox-inner img {\n max-width: 100%;\n max-height: 100%;\n}\n\n.lum-lightbox-image-wrapper {\n vertical-align: middle;\n display: table-cell;\n text-align: center;\n}\n"},{}],5:[function(e,t,i){(function(t){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var n=e("./Luminous"),s=i(n),o=e("./LuminousGallery"),l=i(o);t.Luminous=s["default"],t.LuminousGallery=l["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Luminous":2,"./LuminousGallery":3}],6:[function(e,t,i){"use strict";function n(e){return r?e instanceof HTMLElement:e&&"object"===("undefined"==typeof e?"undefined":l(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function s(e,t){t.forEach(function(t){e.classList.add(t)})}function o(e,t){t.forEach(function(t){e.classList.remove(t)})}Object.defineProperty(i,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};i.isDOMElement=n,i.addClasses=s,i.removeClasses=o;var r="object"===("undefined"==typeof HTMLElement?"undefined":l(HTMLElement))},{}],7:[function(e,t,i){"use strict";function n(){throw new Error("Missing parameter")}Object.defineProperty(i,"__esModule",{value:!0}),i["default"]=n},{}]},{},[5]);
\ No newline at end of file
+!function e(t,i,n){function s(l,r){if(!i[l]){if(!t[l]){var a="function"==typeof require&&require;if(!r&&a)return a(l,!0);if(o)return o(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=i[l]={exports:{}};t[l][0].call(d.exports,function(e){var i=t[l][1][e];return s(i?i:e)},d,d.exports,e,t,i,n)}return i[l].exports}for(var o="function"==typeof require&&require,l=0;lt;t++){var i=this.triggers[t],n=new r["default"](i,this.luminousOpts);this.luminousInstances.push(n)}}},{key:"nextTrigger",value:function(e){var t=Array.prototype.indexOf.call(this.triggers,e)+1;return t>=this.triggers.length?this.triggers[0]:this.triggers[t]}},{key:"previousTrigger",value:function(e){var t=Array.prototype.indexOf.call(this.triggers,e)-1;return 0>t?this.triggers[this.triggers.length-1]:this.triggers[t]}},{key:"destroy",value:function(){}}]),e}();i["default"]=a},{"./Luminous":2,"./util/dom":6}],4:[function(e,t,i){"use strict";function n(){if(!document.querySelector(".lum-base-styles")){var e=document.createElement("style");e.type="text/css",e.classList.add("lum-base-styles"),e.appendChild(document.createTextNode(s));var t=document.head;t.insertBefore(e,t.firstChild)}}Object.defineProperty(i,"__esModule",{value:!0}),i["default"]=n;var s="\n@keyframes lum-noop {\n 0% { zoom: 1; }\n}\n\n.lum-lightbox {\n position: fixed;\n display: none;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n.lum-lightbox.lum-open {\n display: block;\n}\n\n.lum-lightbox.lum-opening, .lum-lightbox.lum-closing {\n animation: lum-noop 1ms;\n}\n\n.lum-lightbox-inner {\n position: absolute;\n top: 0%;\n right: 0%;\n bottom: 0%;\n left: 0%;\n\n overflow: hidden;\n}\n\n.lum-lightbox-loader {\n display: none;\n}\n\n.lum-lightbox-inner img {\n max-width: 100%;\n max-height: 100%;\n}\n\n.lum-lightbox-image-wrapper {\n vertical-align: middle;\n display: table-cell;\n text-align: center;\n}\n"},{}],5:[function(e,t,i){(function(t){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var n=e("./Luminous"),s=i(n),o=e("./LuminousGallery"),l=i(o);t.Luminous=s["default"],t.LuminousGallery=l["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Luminous":2,"./LuminousGallery":3}],6:[function(e,t,i){"use strict";function n(e){return a?e instanceof HTMLElement:e&&"object"===("undefined"==typeof e?"undefined":r(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function s(e,t){t.forEach(function(t){e.classList.add(t)})}function o(e,t){t.forEach(function(t){e.classList.remove(t)})}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};Object.defineProperty(i,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"===l(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":l(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":"undefined"==typeof e?"undefined":l(e)};i.isDOMElement=n,i.addClasses=s,i.removeClasses=o;var a="object"===("undefined"==typeof HTMLElement?"undefined":r(HTMLElement))},{}],7:[function(e,t,i){"use strict";function n(){throw new Error("Missing parameter")}Object.defineProperty(i,"__esModule",{value:!0}),i["default"]=n},{}]},{},[5]);
\ No newline at end of file
diff --git a/package.json b/package.json
index f25b51db..1056bf27 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "luminous-lightbox",
"version": "1.0.0",
"description": "A simple, lightweight, no-dependencies JavaScript image lightbox.",
- "main": "dist/Luminous.js",
+ "main": "src/js/lum-require.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -20,12 +20,14 @@
"url": "https://github.com/imgix/luminous/issues"
},
"homepage": "https://github.com/imgix/luminous#readme",
+ "dependencies": {
+ "babelify": "^7.2.0",
+ "babel-preset-es2015": "^6.3.13",
+ "babel-preset-stage-0": "^6.3.13"
+ },
"devDependencies": {
"babel": "^6.3.13",
"babel-core": "^6.3.21",
- "babel-preset-es2015": "^6.3.13",
- "babel-preset-stage-0": "^6.3.13",
- "babelify": "^7.2.0",
"browserify": "^12.0.1",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.1",
@@ -46,5 +48,8 @@
"run-sequence": "^1.1.5",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
+ },
+ "browserify": {
+ "transform": ["babelify"]
}
}
diff --git a/src/js/lum-require.js b/src/js/lum-require.js
new file mode 100644
index 00000000..d253cd5a
--- /dev/null
+++ b/src/js/lum-require.js
@@ -0,0 +1,4 @@
+import Luminous from './Luminous';
+import LuminousGallery from './LuminousGallery';
+
+export { Luminous, LuminousGallery };