How to use webrtc-adapter (adapter.js) shim in Webpack? -


i have commonjs browser application (typescript) use webpack bundle. uses webrtc want use webrtc-adapter package npm. package adapter.js makes working webrtc between firefox & chrome easier.

inside modules want able access modified navigator item. example, can call:

navigator.mediadevices.getusermedia 

i can work if require package , use variable somewhere in module so:

var webrtc = require("webrtc-adapter"); // somewhere in module console.log(webrtc.browserdetails); 

however, don't need access browserdetails or of exposed items webrtc-adapter, want use shimmed calls on navigator object. i've tried using webpack.provideplugin , externals both still require use object somewhere.

is there way can load shimmed navigator each module without having require , use variable somewhere in modules? know can use external in config , load via separate script tag i'd prefer have webpack bundle together.

have tried requiring this?

require('webrtc-adapter');


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -