Follow

@rune Browserify is really neat in general, the normal way you use it is to just use the (CommonJS) module system in your code and point Browserify at it, and it will produce a bundle including all deps, just one simple invocation without needing a config file.

The standalone mode is a slightly different mode where instead of producing a bundle of your codebase that it *runs* upon loading, it produces a bundle that *assigns the export globally*, usually so that non-Browserified/module-system code can use it externally. Often used for either in-progress migration to module-based code, or quick hacks like this one.

And in standalone mode you can also just point it at some installed module instead of your own code as the entry point, and it'll happily generate a global export for it :)

(Definitely would recommend non-standalone mode for anything serious though, having a module system is *so much nicer* than juggling globals and dealing with scope pollution)

· · Web · 0 · 0 · 1
Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.