Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-07-11 16:06:17 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-07-11 16:06:17 +0300
commitab7f97c011cd5ddb72b269d77dc05aeec21b2607 (patch)
tree088cadeb6629f8260613b965f072098541e5a55b /Makefile
parentc0c7a1c9d9d08383b587dfad3d748f21355d7ae0 (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 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 612707485..4d57891b2 100644
--- a/Makefile
+++ b/Makefile
@@ -66,7 +66,10 @@ bundle-simplewebrtc:
# webrtc-adapter uses JavaScript features not supported by browserify,
# so the sources need to be transformed using babel to a compatible
# version of JavaScript.
- npx browserify --standalone SimpleWebRTC --transform [ babelify --global --presets [ @babel/env ] ] js/simplewebrtc/simplewebrtc.js > js/simplewebrtc/bundled.js
+ # Its main module does no longer provide "module.exports", which is
+ # expected by the code using it, so it needs to be added back with a
+ # plugin.
+ npx browserify --standalone SimpleWebRTC --transform [ babelify --global --presets [ @babel/env ] --plugins [ add-module-exports ] ] js/simplewebrtc/simplewebrtc.js > js/simplewebrtc/bundled.js
create-tag:
git tag -a v$(version) -m "Tagging the $(version) release."