-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minimal example for use in the browser #105
Comments
js-git is packaged as common-js. You'll need to use some sort of build system to pre-process the files for use in the browser. I usually either do it server-side in wheaty https://github.com/creationix/wheaty-cjs-bundler or client side. https://github.com/creationix/tedit/blob/master/build/ui/loader.js You could probably use browersify too, but I haven't tried in a while. http://browserify.org/ |
Here is a example of using wheaty-cjs-bundler. https://github.com/creationix/conquest/blob/svg/conquest.js This repo is served with wheaty https://github.com/creationix/wheaty. Since the file is marked as executable in git and starts with |
Thanks, browserify seems to do the trick! I'll see if I can get a working example and send a pull request with added documentation about build instructions. Do you have any thoughts about rewriting from common-js to AMD? |
I'm glad it helped. No, I'm not going to rewrite in AMD. I may rewrite in On Wed, Sep 10, 2014 at 2:50 AM, Jouke Waleson notifications@github.com
|
@jtwaleson would like to see your work, as I plan to use this with browserify |
A browserified version of js-git (that uses promises instead of generators) can be found here: https://github.com/LivelyKernel/js-git-browser. Thx @creationix for this great project! |
I've been trying to get a minimal setup to work in the browser for a couple of hours now, to no avail. I think it would be useful to explain how the require pattern can be used. It might help javascript noobs like myself on their way.
The text was updated successfully, but these errors were encountered: