Skip to content

Commit

Permalink
feat(*): Make ons object importable with browserify.
Browse files Browse the repository at this point in the history
  • Loading branch information
argelius committed Oct 27, 2015
1 parent b59a611 commit af74e92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 2 additions & 14 deletions core/lib/ons-gesture-detector.js
Expand Up @@ -2059,18 +2059,6 @@ GestureDetector.Instance.prototype = {
};
})('transform');

// AMD export
if(typeof define == 'function' && define.amd) {
define(function() {
return GestureDetector;
});
// commonjs export
} else if(typeof module !== 'undefined' && module.exports) {
module.exports = GestureDetector;
// browser export
} else {
window.ons = window.ons || {};
window.ons.GestureDetector = GestureDetector;
}

window.ons = window.ons || {};
window.ons.GestureDetector = GestureDetector;
})(window);
4 changes: 4 additions & 0 deletions core/setup.es6
Expand Up @@ -32,4 +32,8 @@
} else {
ons._BaseElement = HTMLElement;
}

if (typeof module !== 'undefined' && module.exports) {
module.exports = ons;
}
})(window.ons = window.ons || {});

0 comments on commit af74e92

Please sign in to comment.