machty / emblem-brunch

Emblem.js for Brunch.io
7 stars 13 forks source link

commonjs module.exports is now added to rendered js if brunch setting modules.wrapper is set #7

Closed mrinterweb closed 5 years ago

mrinterweb commented 10 years ago

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.