I'm searching through react-0.13.3.js
and one thing I can't work out. At the very start of the source there's a bunch of dereq()
calls.
'use strict';
var EventPluginUtils = _dereq_(19);
var ReactChildren = _dereq_(32);
var ReactComponent = _dereq_(34);
var ReactClass = _dereq_(33);
But nowhere do I see an implementation for that function. What does it do and how does it work? And most importantly, where is it declared?
This is likely derequire combined with browserify (or other bundler?) module ids. It's a way to rename
require
in your output bundle so as to avoid collisions.Read here for more information: https://github.com/calvinmetcalf/derequire/issues/25
The basic idea is that different module loaders handle
require
differently. "Derequire" is a strategy for binding your requires to your context via a different keyword.