browserify / browserify-handbook

how to build modular applications with browserify
Other
4.58k stars 292 forks source link

globals, but not on window? #56

Open gnimmelf opened 9 years ago

gnimmelf commented 9 years ago

Hi,

I am using Browserify in a legacy browser environment, which means that the window namespace is volatile and unsuitable for storing global variables that I want as globals in my bundles (yes, I want that).

So, I need a way to make globals within a build, either per bundle, or for all bundles.

have been googling this for a while, and can't find a suitable solution, any suggestions before I dig into trying to write a plugin that sets stuff on all modules (doable?).

Thanks.

gnimmelf commented 9 years ago

Ok, I think I need to specify: I'm looking for a way to to set a global state-object, not just make variables available within the module scope...