diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-07-11 16:06:17 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-07-11 16:06:17 +0300 |
commit | ab7f97c011cd5ddb72b269d77dc05aeec21b2607 (patch) | |
tree | 088cadeb6629f8260613b965f072098541e5a55b /package.json | |
parent | c0c7a1c9d9d08383b587dfad3d748f21355d7ae0 (diff) |
Fix "module.exports" no longer available in WebRTC adapter 7.2.5
Since 7.2.5 the "main" property in the "package.json" of WebRTC adapter
points to an ES6 file which does not provide "module.exports" but
"exports.default". Due to this uses of "var adapter =
require('webrtc-adapter');" now fail, as the properties of the module
are loaded in "adapter.default" instead of in "adapter". To restore the
previous and expected behaviour a Babel plugin is now used to also add
"module.exports" if "exports.default" exists.
As WebRTC adapter still provides an ES5 file an alternative solution
would have been to alias "webrtc-adapter" to that file with
'--transform [ aliasify --global --aliases [ --webrtc-adapter
"webrtc-adapter/dist/adapter_core5.js" ] ]'.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'package.json')
-rw-r--r-- | package.json | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/package.json b/package.json index cfa6ebf69..0dc108c4f 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@babel/core": "^7.5.0", "@babel/preset-env": "^7.5.0", "attachmediastream": "^2.1.0", + "babel-plugin-add-module-exports": "^1.0.2", "babelify": "^10.0.0", "browserify": "^16.3.0", "browserslist-config-nextcloud": "0.0.1", |