Gozala/test-commonjs — pull request #5 by bryanforbes (2011-12-28 01:28:58+00:00)
Title: Fixed AMD boilerplate to work with loaders that scan the factory function for `require` calls

AMD loaders like Dojo's scan the string returned by `factory.toString` for `require` calls and append the dependencies to the list of modules to fetch. Because of this, `undefined` in the factory function ends up being set to the first module fetched. It's also best to avoid the `require` scanning since it's inefficient. I've updated the boilerplate to be both AMD and CommonJS compatible.