bits/html5 — pull request #1 by jrburke (2012-05-18 18:04:02+00:00)
Title: Getting closer

I apologize, my editor has a "remove trailing whitespace on save" option, so it shows more changes than what actually occurred:

* using 'index' instead of './index' -- we want a relative module, not a module at the top of the module space.
* In the test page, I set up baseUrl in the test page to be '../lib', and then changed references to core-upgrade to just be 'core-upgrade' since that was at the top of the file.
* One module used 'util', but I just commented out that usage and just did console.log(output) since the browser consoles can show object structures.

Even with those changes though, there are still some missing dependencies:

* assert
* buffer
* events
* jsdom

All except jsdom are node-native modules. So you would need to grab those from the node source tree and AMD convert them, then place them in baseUrl. With jsdom, it is just used by parser.js and it is in an "if(!document)" branch, so you can just comment it out.

Your other option would be to use [browserify](https://github.com/substack/node-browserify) to output a script that would be usable in the browser. It knows how to convert many of the native node modules to something that will run in the browser. It does not output an AMD module, but it will hopefully be a self-contained file that you could then export the main html5 module from using an AMD define call.