machty/emblem-brunch — pull request #7 by mrinterweb (2013-09-05 08:02:57+00:00)
Title: commonjs module.exports is now added to rendered js if brunch setting modules.wrapper is set

I found that if I modified the brunch settings in modules.wrapper to anything but the default of "commonjs", emblem-brunch would continue to append with "module.exports = ...". This was breaking my code when I wanted to turn off commonjs wrapping on my project. After I made this change, everything worked.

I tested by disabling commonjs and enabling commonjs, and it seemed to work as expected. There is apparently one more type of wrapping that brunch provides called "amd". I didn't know how to add that, and there is also the option of creating your own wrapper. I didn't try to support that.

https://github.com/brunch/brunch/blob/stable/docs/config.md

Anyway, I thought this is at least a step in the right direction. Hope you find this useful.