I have been trying to get the dropbox-sdk-js running in the browser. The sdk is developped for node.
What I need is to include the sdk in a <script>
tag and start using the SDK in JS.
I tried Webpack and Browserify. But none of them seem to unentangle the Dropbox
js object from require
for me to use in the browser. Simply requre
is undefined both after webpack and browsify.
-- Reproduce --
Go to the root folder of the repo and execute webpack
. This will read webpack.config.js
and create dropbox-sdk.js
in dist
folder
Include the file in my script <script src="dropbox-sdk.js"></script>
Undefined error come when I try to execute var Dropbox = require('dropbox');
The script is guaranteed to be included correctly. Even tried to use a precompiled one from this CDN.
Any help is appreciated.
If you want to use the dropbox-sdk in browser you either have to use