babel-plugin-transform-modules-requirejs
v0.1.4
Published
Modified babel-plugin-transform-modules-amd for RequireJS
Downloads
385
Maintainers
Readme
babel-plugin-transform-modules-requirejs
A modified version of Babel's AMD Module plugin that removes the 'export' argument from define's factory method and returns the exports:
import Foo from 'foo';
export default {
myFoo: new Foo('bar')
}
Generates:
define(['foo'], function (_foo) {
'use strict';
var exports = {};
Object.defineProperty(exports, "__esModule", {
value: true
});
var _foo2 = _interopRequireDefault(_foo);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
exports.default = {
myFoo: new _foo2.default('bar')
};
return exports.default;
});