thlorenz / browserify-shim

📩 Makes CommonJS incompatible files browserifyable.
MIT License
933 stars 87 forks source link

Modules declared on the script level #185

Closed bvarga closed 9 years ago

bvarga commented 9 years ago

In the docs it's written:

Additionally, it handles the following real-world edge cases:

Modules that just declare a var foo = ... on the script level and assume it gets attached to the window > object. Since the only way they will ever be run is in the global context — "ahem, … NO?!"

How b-shim handles this?

I have a js file containing not just one (two) modules declared in the script level, and couldn't figure out how to access to those modules.

bendrucker commented 9 years ago

browserify-shim injects wrapper code into your files. If you have something specific with an example you're trying to accomplish but aren't managing, let us know.