diff options
author | Marvin Hagemeister <marvin@marvinhagemeister.de> | 2016-01-26 16:53:15 +0100 |
---|---|---|
committer | Marvin Hagemeister <marvin@marvinhagemeister.de> | 2016-01-26 16:53:15 +0100 |
commit | 4fda65c8622f7b91d9ba0a1b2c5ac578b9a44d3b (patch) | |
tree | 340891bcd2ce6809826bf7e20763bc778d4e7c2f /src | |
parent | 01bdcc2b01c87119a6f2a36c3260cf0e7c55ba9a (diff) | |
download | plyr-4fda65c8622f7b91d9ba0a1b2c5ac578b9a44d3b.tar.lz plyr-4fda65c8622f7b91d9ba0a1b2c5ac578b9a44d3b.tar.xz plyr-4fda65c8622f7b91d9ba0a1b2c5ac578b9a44d3b.zip |
Swap CommonJS and AMD module check so that CommonJS is checked first. Fixes Webpack module bundling
Diffstat (limited to 'src')
-rw-r--r-- | src/js/plyr.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index ac6c7d20..8c281d93 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -11,12 +11,12 @@ 'use strict'; /*global define,module*/ - if (typeof define === 'function' && define.amd) { - // AMD - define(null, function() { factory(root, document) }); - } else if (typeof module === 'object') { + if (typeof module === 'object') { // Node, CommonJS-like module.exports = factory(root, document); + } else if (typeof define === 'function' && define.amd) { + // AMD + define(null, function() { factory(root, document) }); } else { // Browser globals (root is window) root.plyr = factory(root, document); |