OpenShare / openshare

Customizable API wrappers for social platforms
http://openshare.social
113 stars 17 forks source link

removal of browser.js in favor of `browserify --standalone` #3

Open jakeburden opened 8 years ago

jakeburden commented 8 years ago

We may be able to remove the browser.js file and change our build steps to look more like this:

"watch:js": "watchify -s src/index.js -o dist/openshare.js -dv",
"build:js": "browserify -s src/index.js -g uglifyify | uglifyjs -cm > dist/openshare.js",

notice the -s flag and change in entry point from src/browser.js to src/index.js

from the browserify docs:

--standalone -s  Generate a UMD bundle for the supplied export name.
                   This bundle works with other module systems and sets the name
                   given as a window global if no module system is found.
jakeburden commented 8 years ago

some problems have been reported with gulp build systems not playing well with the pre-compiled version.

I think think fixing this issue would resolve those issues.

until then use this cdn for a pre-compiled version:

<script  src='https://cdn.rawgit.com/OpenShare/openshare/master/dist/openshare.js'></script>

npm/browserify run scripts seem to work well for me as well but that might not be the case for everyone