I am using babel to transpile ES2015 code to ES5 & RequireJS.
But when I use the following syntax:
const o = { foo: 'foo' };
export default o;
The transpiled result is an object with a default
property on it.
ie. it is currently transpiled to something like:
define(function() {
return {
default: {
foo: 'foo'
}
};
});
What I want is the object literal itself (containing the foo property) to be returned directly.
ie. I want something like:
define(function() {
return {
foo: 'foo'
};
});
Can I achieve this?