diff --git a/src/events.js b/src/events.js index cd24961b2c7..26a9f138283 100644 --- a/src/events.js +++ b/src/events.js @@ -1,4 +1,4 @@ -module.exports = { +export default { // fired before MediaSource is attaching to media element - data: { media } MEDIA_ATTACHING: 'hlsMediaAttaching', // fired when MediaSource has been succesfully attached to media element - data: { } diff --git a/src/helper/buffer-helper.js b/src/helper/buffer-helper.js index 9e3b25c7145..e9188cf3cb2 100644 --- a/src/helper/buffer-helper.js +++ b/src/helper/buffer-helper.js @@ -83,4 +83,4 @@ const BufferHelper = { } }; -module.exports = BufferHelper; +export default BufferHelper; diff --git a/src/index.js b/src/index.js deleted file mode 100644 index d87cf3a8ca6..00000000000 --- a/src/index.js +++ /dev/null @@ -1,4 +0,0 @@ -// This is mostly for support of the es6 module export -// syntax with the babel compiler, it looks like it doesnt support -// function exports like we are used to in node/commonjs -module.exports = require('./hls.js').default; diff --git a/src/utils/binary-search.js b/src/utils/binary-search.js index a27ce1983b3..05a71b11834 100644 --- a/src/utils/binary-search.js +++ b/src/utils/binary-search.js @@ -40,4 +40,4 @@ var BinarySearch = { } }; -module.exports = BinarySearch; +export default BinarySearch; diff --git a/src/utils/hex.js b/src/utils/hex.js index b25f50a0081..d5247adb8a3 100644 --- a/src/utils/hex.js +++ b/src/utils/hex.js @@ -16,4 +16,4 @@ const Hex = { } }; -module.exports = Hex; +export default Hex; diff --git a/src/utils/timeRanges.js b/src/utils/timeRanges.js index 280866190ec..e34a102249e 100644 --- a/src/utils/timeRanges.js +++ b/src/utils/timeRanges.js @@ -12,4 +12,4 @@ const TimeRanges = { } }; -module.exports = TimeRanges; +export default TimeRanges; diff --git a/webpack.config.js b/webpack.config.js index d58b104475a..5162fbc845b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,8 +4,25 @@ var webpack = require('webpack') var buildVersion = process.env.BUILD_VERSION || 'full' -var config = { - entry: './src/index.js', +const buildConstants = { + __VERSION__: JSON.stringify(pkgJson.version), + __BUILD_VERSION__: process.env.BUILD_VERSION || 'full' +}; + +const uglifyJsOptions = { + screwIE8: true, + stats: true, + compress: { + warnings: false + }, + mangle: { + toplevel: true, + eval: true + } +}; + +const commonConfig = { + entry: './src/hls.js', module: { rules: [ {