Skip to content

Commit

Permalink
refactor: Remove custom UMD (#3826)
Browse files Browse the repository at this point in the history
Only use `module.exports` for better compatibility between bundlers and module systems.
  • Loading branch information
misteroneill authored and gkatsev committed Jan 18, 2017
1 parent 5377ffc commit 2014120
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
* @file video.js
* @module videojs
*/

/* global define */

import window from 'global/window';
import document from 'global/document';
import * as setup from './setup';
Expand Down Expand Up @@ -629,19 +626,6 @@ videojs.insertContent = Dom.insertContent;
*/
videojs.computedStyle = computedStyle;

/*
* Custom Universal Module Definition (UMD)
*
* Video.js will never be a non-browser lib so we can simplify UMD a bunch and
* still support requirejs and browserify. This also needs to be closure
* compiler compatible, so string keys are used.
*/
if (typeof define === 'function' && define.amd) {
define('videojs', [], () => videojs);

// checking that module is an object too because of umdjs/umd#35
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = videojs;
}

export default videojs;
// We use Node-style module.exports here instead of ES6 because it is more
// compatible with different module systems.
module.exports = videojs;

0 comments on commit 2014120

Please sign in to comment.