monokrome / brunch-for-libs

A brunch skeleton for creating javascript libraries, as opposed to full applications.
2 stars 1 forks source link

Brunch does not wrap the entire project in a namespace function #1

Open monokrome opened 11 years ago

monokrome commented 11 years ago

This project needs to be in it's own namespace, but brunch does not wrap output in a namespace if you aren't using CommonJS modules. If you are using them, then it creates a separate namespace for each file as expected by the CommonJS require method.

peterwilli commented 10 years ago

@monokrome I just made a plugin that does this. I used it for my Javascript SDK in combination with brunch-for-libs. Maybe we can include it by default if you like. See: https://github.com/LogAndRoll/singlewrap-brunch

peterwilli commented 10 years ago

Didnt got time yet to add a good documentation but it's pretty simple to use. Upon inclusion it will wrap all a joined / minified JS file in 1 self executing function, with options to customize.