Openvidu-browser NPM package doesn't work without Babel

Hi @micael.gallego i found out right way of importing compiled JS!

As long as compiled OpenVidu-browser is self-invoked js function, this works for me:

import "../assets/openvidu-browser-2.18.0.min.js";

...
mounted(){
 // Get Token from backend
 let body = { secret: this.secret, room: this.roomId };

      postFetch("api2/video", body).then((respond) => {
        // When token recieved from backend start your connection

        this.token = respond;
        this.joinSession(); // Start you openvidu logic here   
      });
}

This seems to me more correct way of importing openvidu-browser.js, as in this case *.js will be included in final build of application. Final size of Video.js chunk in my build is 231 kb.

As long as i don’t know how to make OpenVidu-npm package work with Vite, will mark this as solution.

@mihailj probably it would be somehow helpful for you

@micael.gallego @mihailj Thank you guys for you help with investigating this case

1 Like