Closed rubensolx closed 4 years ago
Hi @rubensolx
You can do that already, a minified version of SDK is available in npm registry
so you probably can require it in your app
Is it what you are looking for?
Hi Dave, What I checked is that the NodeJS SDK is available on NPM. I can't use it together with Webpack because within it is using a lot of internal Node libs. This same package can also be used for JavaScript? I mean, if I add as externals all the Node requires, It'll work on the browser?
Best,
Hi @rubensolx
To build with the Webpack you can add externals: ['nativescript-xmpp-client', 'node-xmpp-client', 'node-fetch', 'form-data']
to the Webpack's config.
But make sure you connect the connectycube SDK as require('connectycube')
, it's important to that the entry point was from connectycube/src/cubeMain.js
Awesome :) Can you provide the source-map together with the minified file?
You don't need the source-map for previous tip, because the minified sdk won't use in your build. So, you able to use your own source-maps.
The ConnectyCube SDK has the source-map with minified file, but for build with Gulp+Browserify tools and nodejs libs (cdn.jsdelivr.net/npm/connectycube).
We have a Webpack build for the browser version, it will be released later after tests.
I mean, not on build but on development mode (my build will not be minified, so it will use the source-map from connecty-cube) That's pretty much the need for it :)
As source-map file is provided now, so closing it
Hi, Do you plan release the JS (browser) version as a npm package (or adapt the current one to use UMD)?
This is very important for the ones that make use of bundlers and want to control the version of the lib (as the react-native and nodejs devs do currently)
Cheers,