clux / modul8

NO LONGER MAINTAINED - browserify is too similar and is better (see issues)
http://clux.github.com/modul8
MIT License
22 stars 4 forks source link

module.exports is not set #7

Closed Raynos closed 12 years ago

Raynos commented 12 years ago

if (typeof module !== "undefined" && module.exports) {

fails. Also module.exports.foo = ... fails because module.exports is not set.

Some people use module.exports.foo = ... instead of exports.foo = ...

clux commented 12 years ago

Hm, I'm not sure that's entirely within spec. That said, it should be straightforward to change as googling around reveals you are right about people using it. Will try to get out a patch later.

Raynos commented 12 years ago

https://github.com/joyent/node/blob/master/lib/module.js#L39

It's in the code.

clux commented 12 years ago

Fixed.

Note that touching both exports and module.exports will still force module.exports to take priority.