babel-plugin-transform-amd-system-wrapper
Version:
Wraps AMD scripts into System.registerDynamic(...
12 lines (10 loc) • 379 B
JavaScript
var factory = { amd: 'object' };
// a factory identifier with no dependencies needs a typeof check in the output
// this check can probably be inlined by static analysis for certain cases
System.registerDynamic([], false, function ($__require, $__exports, $__module) {
if (typeof factory === 'function') {
return factory.call(this);
} else {
return factory;
}
});