videojs-contrib-quality-levels
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -0,1 +1,8 @@ | ||
<a name="2.0.6"></a> | ||
## [2.0.6](https://github.com/videojs/videojs-contrib-quality-levels/compare/v2.0.5...v2.0.6) (2018-08-03) | ||
### Bug Fixes | ||
* babel the es dist, by updating the generator (#45) ([0123ee8](https://github.com/videojs/videojs-contrib-quality-levels/commit/0123ee8)), closes [#45](https://github.com/videojs/videojs-contrib-quality-levels/issues/45) | ||
<a name="2.0.5"></a> | ||
@@ -2,0 +9,0 @@ ## 2.0.5 (2018-07-05) |
@@ -1,2 +0,2 @@ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.5 @license Apache-2.0 */ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.6 @license Apache-2.0 */ | ||
'use strict'; | ||
@@ -7,31 +7,4 @@ | ||
var videojs = _interopDefault(require('video.js')); | ||
var document = _interopDefault(require('global/document')); | ||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
var empty = {}; | ||
var empty$1 = /*#__PURE__*/Object.freeze({ | ||
default: empty | ||
}); | ||
var minDoc = ( empty$1 && empty ) || empty$1; | ||
var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : | ||
typeof window !== 'undefined' ? window : {}; | ||
var doccy; | ||
if (typeof document !== 'undefined') { | ||
doccy = document; | ||
} else { | ||
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
if (!doccy) { | ||
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; | ||
} | ||
} | ||
var document_1 = doccy; | ||
var classCallCheck = function (instance, Constructor) { | ||
@@ -101,3 +74,3 @@ if (!(instance instanceof Constructor)) { | ||
if (videojs.browser.IS_IE8) { | ||
level = document_1.createElement('custom'); | ||
level = document.createElement('custom'); | ||
for (var prop in QualityLevel.prototype) { | ||
@@ -175,3 +148,3 @@ if (prop !== 'constructor') { | ||
if (videojs.browser.IS_IE8) { | ||
list = document_1.createElement('custom'); | ||
list = document.createElement('custom'); | ||
for (var prop in QualityLevelList.prototype) { | ||
@@ -178,0 +151,0 @@ if (prop !== 'constructor') { |
@@ -1,32 +0,35 @@ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.5 @license Apache-2.0 */ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.6 @license Apache-2.0 */ | ||
import videojs from 'video.js'; | ||
import document from 'global/document'; | ||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
var classCallCheck = function (instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
}; | ||
var empty = {}; | ||
var inherits = function (subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); | ||
} | ||
var empty$1 = /*#__PURE__*/Object.freeze({ | ||
default: empty | ||
}); | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; | ||
}; | ||
var minDoc = ( empty$1 && empty ) || empty$1; | ||
var possibleConstructorReturn = function (self, call) { | ||
if (!self) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : | ||
typeof window !== 'undefined' ? window : {}; | ||
return call && (typeof call === "object" || typeof call === "function") ? call : self; | ||
}; | ||
var doccy; | ||
if (typeof document !== 'undefined') { | ||
doccy = document; | ||
} else { | ||
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
if (!doccy) { | ||
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; | ||
} | ||
} | ||
var document_1 = doccy; | ||
/** | ||
@@ -46,58 +49,61 @@ * A single QualityLevel. | ||
*/ | ||
class QualityLevel { | ||
/** | ||
* Creates a QualityLevel | ||
* | ||
* @param {Representation|Object} representation The representation of the quality level | ||
* @param {string} representation.id Unique id of the QualityLevel | ||
* @param {number=} representation.width Resolution width of the QualityLevel | ||
* @param {number=} representation.height Resolution height of the QualityLevel | ||
* @param {number} representation.bandwidth Bitrate of the QualityLevel | ||
* @param {Function} representation.enabled Callback to enable/disable QualityLevel | ||
*/ | ||
constructor(representation) { | ||
var QualityLevel = | ||
let level = this; // eslint-disable-line | ||
/** | ||
* Creates a QualityLevel | ||
* | ||
* @param {Representation|Object} representation The representation of the quality level | ||
* @param {string} representation.id Unique id of the QualityLevel | ||
* @param {number=} representation.width Resolution width of the QualityLevel | ||
* @param {number=} representation.height Resolution height of the QualityLevel | ||
* @param {number} representation.bandwidth Bitrate of the QualityLevel | ||
* @param {Function} representation.enabled Callback to enable/disable QualityLevel | ||
*/ | ||
function QualityLevel(representation) { | ||
classCallCheck(this, QualityLevel); | ||
if (videojs.browser.IS_IE8) { | ||
level = document_1.createElement('custom'); | ||
for (const prop in QualityLevel.prototype) { | ||
if (prop !== 'constructor') { | ||
level[prop] = QualityLevel.prototype[prop]; | ||
} | ||
var level = this; // eslint-disable-line | ||
if (videojs.browser.IS_IE8) { | ||
level = document.createElement('custom'); | ||
for (var prop in QualityLevel.prototype) { | ||
if (prop !== 'constructor') { | ||
level[prop] = QualityLevel.prototype[prop]; | ||
} | ||
} | ||
} | ||
level.id = representation.id; | ||
level.label = level.id; | ||
level.width = representation.width; | ||
level.height = representation.height; | ||
level.bitrate = representation.bandwidth; | ||
level.enabled_ = representation.enabled; | ||
level.id = representation.id; | ||
level.label = level.id; | ||
level.width = representation.width; | ||
level.height = representation.height; | ||
level.bitrate = representation.bandwidth; | ||
level.enabled_ = representation.enabled; | ||
Object.defineProperty(level, 'enabled', { | ||
/** | ||
* Get whether the QualityLevel is enabled. | ||
* | ||
* @returns {boolean} True if the QualityLevel is enabled. | ||
*/ | ||
get() { | ||
return level.enabled_(); | ||
}, | ||
Object.defineProperty(level, 'enabled', { | ||
/** | ||
* Get whether the QualityLevel is enabled. | ||
* | ||
* @returns {boolean} True if the QualityLevel is enabled. | ||
*/ | ||
get: function get$$1() { | ||
return level.enabled_(); | ||
}, | ||
/** | ||
* Enable or disable the QualityLevel. | ||
* | ||
* @param {boolean} enable true to enable QualityLevel, false to disable. | ||
*/ | ||
set(enable) { | ||
level.enabled_(enable); | ||
} | ||
}); | ||
return level; | ||
} | ||
} | ||
/** | ||
* Enable or disable the QualityLevel. | ||
* | ||
* @param {boolean} enable true to enable QualityLevel, false to disable. | ||
*/ | ||
set: function set$$1(enable) { | ||
level.enabled_(enable); | ||
} | ||
}); | ||
return level; | ||
}; | ||
/** | ||
@@ -123,11 +129,18 @@ * A list of QualityLevels. | ||
*/ | ||
class QualityLevelList extends videojs.EventTarget { | ||
constructor() { | ||
super(); | ||
let list = this; // eslint-disable-line | ||
var QualityLevelList = function (_videojs$EventTarget) { | ||
inherits(QualityLevelList, _videojs$EventTarget); | ||
function QualityLevelList() { | ||
var _ret; | ||
classCallCheck(this, QualityLevelList); | ||
var _this = possibleConstructorReturn(this, _videojs$EventTarget.call(this)); | ||
var list = _this; // eslint-disable-line | ||
if (videojs.browser.IS_IE8) { | ||
list = document_1.createElement('custom'); | ||
for (const prop in QualityLevelList.prototype) { | ||
list = document.createElement('custom'); | ||
for (var prop in QualityLevelList.prototype) { | ||
if (prop !== 'constructor') { | ||
@@ -149,3 +162,3 @@ list[prop] = QualityLevelList.prototype[prop]; | ||
Object.defineProperty(list, 'selectedIndex', { | ||
get() { | ||
get: function get$$1() { | ||
return list.selectedIndex_; | ||
@@ -162,3 +175,3 @@ } | ||
Object.defineProperty(list, 'length', { | ||
get() { | ||
get: function get$$1() { | ||
return list.levels_.length; | ||
@@ -168,3 +181,3 @@ } | ||
return list; | ||
return _ret = list, possibleConstructorReturn(_this, _ret); | ||
} | ||
@@ -184,5 +197,7 @@ | ||
*/ | ||
addQualityLevel(representation) { | ||
let qualityLevel = this.getQualityLevelById(representation.id); | ||
QualityLevelList.prototype.addQualityLevel = function addQualityLevel(representation) { | ||
var qualityLevel = this.getQualityLevelById(representation.id); | ||
// Do not add duplicate quality levels | ||
@@ -193,3 +208,3 @@ if (qualityLevel) { | ||
const index = this.levels_.length; | ||
var index = this.levels_.length; | ||
@@ -200,3 +215,3 @@ qualityLevel = new QualityLevel(representation); | ||
Object.defineProperty(this, index, { | ||
get() { | ||
get: function get$$1() { | ||
return this.levels_[index]; | ||
@@ -210,3 +225,3 @@ } | ||
this.trigger({ | ||
qualityLevel, | ||
qualityLevel: qualityLevel, | ||
type: 'addqualitylevel' | ||
@@ -216,3 +231,3 @@ }); | ||
return qualityLevel; | ||
} | ||
}; | ||
@@ -226,6 +241,8 @@ /** | ||
*/ | ||
removeQualityLevel(qualityLevel) { | ||
let removed = null; | ||
for (let i = 0, l = this.length; i < l; i++) { | ||
QualityLevelList.prototype.removeQualityLevel = function removeQualityLevel(qualityLevel) { | ||
var removed = null; | ||
for (var i = 0, l = this.length; i < l; i++) { | ||
if (this[i] === qualityLevel) { | ||
@@ -245,3 +262,3 @@ removed = this.levels_.splice(i, 1)[0]; | ||
this.trigger({ | ||
qualityLevel, | ||
qualityLevel: qualityLevel, | ||
type: 'removequalitylevel' | ||
@@ -252,3 +269,3 @@ }); | ||
return removed; | ||
} | ||
}; | ||
@@ -262,6 +279,8 @@ /** | ||
*/ | ||
getQualityLevelById(id) { | ||
for (let i = 0, l = this.length; i < l; i++) { | ||
const level = this[i]; | ||
QualityLevelList.prototype.getQualityLevelById = function getQualityLevelById(id) { | ||
for (var i = 0, l = this.length; i < l; i++) { | ||
var level = this[i]; | ||
if (level.id === id) { | ||
@@ -272,3 +291,3 @@ return level; | ||
return null; | ||
} | ||
}; | ||
@@ -280,8 +299,12 @@ /** | ||
*/ | ||
dispose() { | ||
QualityLevelList.prototype.dispose = function dispose() { | ||
this.selectedIndex_ = -1; | ||
this.levels_.length = 0; | ||
} | ||
} | ||
}; | ||
return QualityLevelList; | ||
}(videojs.EventTarget); | ||
/** | ||
@@ -292,2 +315,4 @@ * change - The selected QualityLevel has changed. | ||
*/ | ||
QualityLevelList.prototype.allowedEvents_ = { | ||
@@ -300,3 +325,3 @@ change: 'change', | ||
// emulate attribute EventHandler support to allow for feature detection | ||
for (const event in QualityLevelList.prototype.allowedEvents_) { | ||
for (var event in QualityLevelList.prototype.allowedEvents_) { | ||
QualityLevelList.prototype['on' + event] = null; | ||
@@ -306,3 +331,3 @@ } | ||
// vjs 5/6 support | ||
const registerPlugin = videojs.registerPlugin || videojs.plugin; | ||
var registerPlugin = videojs.registerPlugin || videojs.plugin; | ||
@@ -317,8 +342,8 @@ /** | ||
*/ | ||
const initPlugin = function(player, options) { | ||
const originalPluginFn = player.qualityLevels; | ||
var initPlugin = function initPlugin(player, options) { | ||
var originalPluginFn = player.qualityLevels; | ||
const qualityLevelList = new QualityLevelList(); | ||
var qualityLevelList = new QualityLevelList(); | ||
const disposeHandler = function() { | ||
var disposeHandler = function disposeHandler() { | ||
qualityLevelList.dispose(); | ||
@@ -331,3 +356,5 @@ player.qualityLevels = originalPluginFn; | ||
player.qualityLevels = () => qualityLevelList; | ||
player.qualityLevels = function () { | ||
return qualityLevelList; | ||
}; | ||
player.qualityLevels.VERSION = '__VERSION__'; | ||
@@ -349,3 +376,3 @@ | ||
*/ | ||
const qualityLevels = function(options) { | ||
var qualityLevels = function qualityLevels(options) { | ||
return initPlugin(this, videojs.mergeOptions({}, options)); | ||
@@ -352,0 +379,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.5 @license Apache-2.0 */ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.6 @license Apache-2.0 */ | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js'), require('global/document')) : |
@@ -1,2 +0,2 @@ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.5 @license Apache-2.0 */ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.6 @license Apache-2.0 */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js"),require("global/document")):"function"==typeof define&&define.amd?define(["video.js","global/document"],t):e.videojsContribQualityLevels=t(e.videojs,e.document)}(this,function(e,t){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t;var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},i=function(i){function o(){n(this,o);var l=r(this,i.call(this)),s=l;if(e.browser.IS_IE8)for(var u in s=t.createElement("custom"),o.prototype)"constructor"!==u&&(s[u]=o.prototype[u]);return s.levels_=[],s.selectedIndex_=-1,Object.defineProperty(s,"selectedIndex",{get:function(){return s.selectedIndex_}}),Object.defineProperty(s,"length",{get:function(){return s.levels_.length}}),r(l,s)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,i),o.prototype.addQualityLevel=function(r){var i=this.getQualityLevelById(r.id);if(i)return i;var o=this.levels_.length;return i=new function r(i){n(this,r);var o=this;if(e.browser.IS_IE8)for(var l in o=t.createElement("custom"),r.prototype)"constructor"!==l&&(o[l]=r.prototype[l]);return o.id=i.id,o.label=o.id,o.width=i.width,o.height=i.height,o.bitrate=i.bandwidth,o.enabled_=i.enabled,Object.defineProperty(o,"enabled",{get:function(){return o.enabled_()},set:function(e){o.enabled_(e)}}),o}(r),""+o in this||Object.defineProperty(this,o,{get:function(){return this.levels_[o]}}),this.levels_.push(i),this.trigger({qualityLevel:i,type:"addqualitylevel"}),i},o.prototype.removeQualityLevel=function(e){for(var t=null,n=0,r=this.length;n<r;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t},o.prototype.getQualityLevelById=function(e){for(var t=0,n=this.length;t<n;t++){var r=this[t];if(r.id===e)return r}return null},o.prototype.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},o}(e.EventTarget);for(var o in i.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},i.prototype.allowedEvents_)i.prototype["on"+o]=null;var l=function(t){return n=this,e.mergeOptions({},t),r=n.qualityLevels,o=new i,n.on("dispose",function e(){o.dispose(),n.qualityLevels=r,n.off("dispose",e)}),n.qualityLevels=function(){return o},n.qualityLevels.VERSION="__VERSION__",o;var n,r,o};return(e.registerPlugin||e.plugin)("qualityLevels",l),l.VERSION="__VERSION__",l}); |
{ | ||
"name": "videojs-contrib-quality-levels", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Exposes a list of quality levels available for the source.", | ||
@@ -8,3 +8,3 @@ "main": "dist/videojs-contrib-quality-levels.cjs.js", | ||
"generator-videojs-plugin": { | ||
"version": "6.1.1" | ||
"version": "6.1.4" | ||
}, | ||
@@ -90,3 +90,3 @@ "repository": "videojs/videojs-contrib-quality-levels", | ||
"rimraf": "^2.6.1", | ||
"rollup": "^0.60.1", | ||
"rollup": "^0.63.2", | ||
"rollup-plugin-babel": "^3.0.4", | ||
@@ -103,3 +103,3 @@ "rollup-plugin-commonjs": "^9.1.3", | ||
"videojs-contrib-hls": "^4.1.0", | ||
"videojs-standard": "^6.0.0" | ||
"videojs-standard": "^6.0.3" | ||
}, | ||
@@ -106,0 +106,0 @@ "module": "dist/videojs-contrib-quality-levels.es.js", |
@@ -13,8 +13,13 @@ /** | ||
/* General Globals */ | ||
const moduleName = 'videojsContribQualityLevels'; | ||
const pluginName = 'videojs-contrib-quality-levels'; | ||
const mainFile = 'src/plugin.js'; | ||
const banner = `/*! @name ${pkg.name} @version ${pkg.version} @license ${pkg.license} */`; | ||
/* to prevent going into a screen during rollup */ | ||
process.stderr.isTTY = false; | ||
let isWatch = false; | ||
process.argv.forEach((a) => { | ||
if ((/-w|--watch/).test(a)) { | ||
isWatch = true; | ||
} | ||
}); | ||
/* configuration for plugins */ | ||
@@ -40,15 +45,7 @@ const primedPlugins = { | ||
// to prevent a screen during rollup watch/build | ||
process.stderr.isTTY = false; | ||
/* General Globals */ | ||
const moduleName = 'videojsContribQualityLevels'; | ||
const pluginName = 'videojs-contrib-quality-levels'; | ||
let isWatch = false; | ||
process.argv.forEach((a) => { | ||
if ((/-w|--watch/).test(a)) { | ||
isWatch = true; | ||
} | ||
}); | ||
// globals, aka replace require calls | ||
// with this | ||
// globals, aka replace require calls with this | ||
const globals = { | ||
@@ -72,5 +69,4 @@ umd: { | ||
// externals, aka don't bundle there | ||
// and if not listed as a global don't require | ||
// them either | ||
// externals, aka don't bundle these and if not | ||
// listed as a global don't require them either | ||
const externals = { | ||
@@ -81,3 +77,5 @@ umd: Object.keys(globals.umd).concat([ | ||
module: Object.keys(globals.module).concat([ | ||
'global', | ||
'global/document', | ||
'global/window' | ||
]), | ||
@@ -92,3 +90,2 @@ test: Object.keys(globals.test).concat([ | ||
// note uglify will be added before babel for minified bundle | ||
// see minPlugins below | ||
umd: [ | ||
@@ -101,4 +98,2 @@ primedPlugins.resolve, | ||
// note babel will be removed for es module bundle | ||
// see esPlugins below | ||
module: [ | ||
@@ -120,77 +115,76 @@ primedPlugins.resolve, | ||
// clone module plugins, remove babel | ||
const esPlugins = plugins.module.slice(); | ||
/* make a build with the specifed settings */ | ||
const makeBuild = (name, settings) => { | ||
const b = Object.assign({}, { | ||
plugins: plugins[name], | ||
external: externals[name], | ||
input: 'src/plugin.js' | ||
}, settings); | ||
esPlugins.splice(plugins.module.indexOf(primedPlugins.babel), 1); | ||
const fixOutput = (o) => { | ||
if (!o.banner) { | ||
o.banner = `/*! @name ${pkg.name} @version ${pkg.version} @license ${pkg.license} */`; | ||
} | ||
if (!o.globals) { | ||
o.globals = globals[name]; | ||
} | ||
// clone umd plugins, remove babel, add uglify then babel | ||
const minPlugins = plugins.umd.slice(); | ||
return o; | ||
}; | ||
minPlugins.splice(plugins.umd.indexOf(primedPlugins.babel), 1); | ||
minPlugins.push(primedPlugins.uglify); | ||
minPlugins.push(primedPlugins.babel); | ||
if (!Array.isArray(b.output)) { | ||
b.output = fixOutput(b.output); | ||
} else { | ||
b.output = b.output.map(fixOutput); | ||
} | ||
const builds = [{ | ||
// umd | ||
input: mainFile, | ||
output: { | ||
name: moduleName, | ||
file: `dist/${pluginName}.js`, | ||
format: 'umd', | ||
globals: globals.umd, | ||
banner | ||
}, | ||
external: externals.umd, | ||
plugins: plugins.umd | ||
}, { | ||
// cjs | ||
input: mainFile, | ||
output: [{ | ||
file: `dist/${pluginName}.cjs.js`, | ||
format: 'cjs', | ||
globals: globals.module, | ||
banner | ||
}], | ||
external: externals.module, | ||
plugins: plugins.module | ||
}, { | ||
// es | ||
input: mainFile, | ||
output: [{ | ||
file: `dist/${pluginName}.es.js`, | ||
format: 'es', | ||
globals: globals.module, | ||
banner | ||
}], | ||
external: externals.module, | ||
plugins: esPlugins | ||
}, { | ||
// test bundle | ||
input: 'test/**/*.test.js', | ||
output: { | ||
name: `${moduleName}Tests`, | ||
file: 'test/dist/bundle.js', | ||
format: 'iife', | ||
globals: globals.test | ||
}, | ||
external: externals.test, | ||
plugins: plugins.test | ||
}]; | ||
return b; | ||
}; | ||
/* all rollup builds by name. note only object values will be used */ | ||
const builds = { | ||
umd: makeBuild('umd', { | ||
output: [{ | ||
name: moduleName, | ||
file: `dist/${pluginName}.js`, | ||
format: 'umd' | ||
}] | ||
}), | ||
cjs: makeBuild('module', { | ||
output: [{ | ||
file: `dist/${pluginName}.cjs.js`, | ||
format: 'cjs' | ||
}] | ||
}), | ||
es: makeBuild('module', { | ||
output: [{ | ||
file: `dist/${pluginName}.es.js`, | ||
format: 'es' | ||
}] | ||
}), | ||
test: makeBuild('test', { | ||
input: 'test/**/*.test.js', | ||
output: [{ | ||
name: `${moduleName}Tests`, | ||
file: 'test/dist/bundle.js', | ||
format: 'iife' | ||
}] | ||
}) | ||
}; | ||
if (!isWatch) { | ||
builds.push({ | ||
// minified umd | ||
input: mainFile, | ||
output: { | ||
builds.minUmd = makeBuild('umd', { | ||
output: [{ | ||
name: moduleName, | ||
file: `dist/${pluginName}.min.js`, | ||
format: 'umd', | ||
globals: globals.umd, | ||
banner | ||
}, | ||
external: externals.umd, | ||
plugins: minPlugins | ||
format: 'umd' | ||
}], | ||
// we need to minify before babel | ||
plugins: plugins.umd | ||
.filter((p) => p !== primedPlugins.babel) | ||
.concat([primedPlugins.uglify, primedPlugins.babel]) | ||
}); | ||
} | ||
export default builds; | ||
export default Object.values(builds); |
@@ -0,1 +1,2 @@ | ||
/*! @name videojs-contrib-quality-levels @version 2.0.6 @license Apache-2.0 */ | ||
(function (videojs,QUnit,sinon) { | ||
@@ -2,0 +3,0 @@ 'use strict'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 10 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1150918
54
2714
11