rjs-commonjs
Extracted commonJs (and dependencies) module from jrburke/r.js.
Allows to wrap CommonJS modules with define
statements including dependency list for AMD environment,
but without pulling all the dependencies, as r.js
does it.
Also exposes rjsCommonjs.commonjs
and rjsCommonjs.transform
objects from r.js
if greater flexibility is required.
Example
var fs = ;var rjsCommonjs = ; var moduleName = 'rendr/client/app_view';var content = fs; console; // wraps with define statement// and adds list of dependenciescontent = ; console;
Before
var _ = Backbone = BaseView = isServer = typeof window === 'undefined'; if !isServer Backbone$ = window$ || ; moduleexports = BaseView;
After
;
License
MIT