fent/randexp.js — Issue #4: Instead of browserify simply modify your export pattern.
Author: jdalton
Created: 2011-12-30 15:49:09+00:00
State: open

Browserify adds `require()` to the global object in the browser that can conflict with AMD loaders like [RequireJS](http://requirejs.org/) / [Curl.js](https://github.com/unscriptable/curl/wiki). It also pollutes the global with utility methods/objects like `Object_keys` and `process`.

Instead you can mod the way you export the `RandExp` constructor.
Take a look at how I do this in [Benchmark.js](https://github.com/bestiejs/benchmark.js/blob/ba3bf0b85e4de46783980a99ec165ea385337c83/benchmark.js#L3224-3255) or how the proposed Backbone.js patch [does it](https://github.com/jrburke/backbone/blob/2b0cfb4282f071cffb14a9573d703da6acc5febd/backbone.js#L8-22).