browserify-handbook icon indicating copy to clipboard operation
browserify-handbook copied to clipboard

globals, but not on window?

Open gnimmelf opened this issue 10 years ago • 1 comments

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 avatar Aug 11 '15 09:08 gnimmelf

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...

gnimmelf avatar Aug 12 '15 06:08 gnimmelf