babel-plugin-rewire-exports

Babel plugin for stubbing [ES6, ES2015] module exports

MIT License

Downloads
33.9K
Stars
66
Committers
4

Bot releases are visible (Hide)

babel-plugin-rewire-exports - Latest Release

Published by asapach almost 4 years ago

fixed #28

babel-plugin-rewire-exports -

Published by asapach over 4 years ago

fixed #25 and refactored variable declarations in named exports

babel-plugin-rewire-exports -

Published by asapach almost 5 years ago

Improved support for typescript

babel-plugin-rewire-exports -

Published by asapach about 5 years ago

Potential breaking change: functions are now converted into a function expression and exported variable by the same name. Example:

export default function foo() {
  return null;
}

Becomes:

var foo = function foo() {
  return null;
};
export { foo as default };

And for named exports:

export function foo() {
  return null;
}

Becomes:

var foo = function foo() {
  return null;
};

export { foo };
babel-plugin-rewire-exports -

Published by asapach about 5 years ago

Changed the way constant exports are handled by default:

  • Previously named constant exports (e.g. export const foo = 'bar') were ignored by default. While default constant exports (e.g. export default foo) were treated similar to other immutable values like literals, globals and imports.
  • Now the behavior is consistent for both named and default exports: the exported values are rewired, but the original variables are left intact. Constants cannot be rewired within the module unless unsafeConst option is used.

Thanks to @sergei-startsev for most of the work.

babel-plugin-rewire-exports -

Published by asapach over 5 years ago

unsafeConst option should now allow to modify constant bindings inside the module, #15

babel-plugin-rewire-exports -

Published by asapach over 5 years ago

fixed #13

babel-plugin-rewire-exports -

Published by asapach about 6 years ago

The latest version now targets Babel v7.
If you're still on Babel v6, keep using 0.x releases.

babel-plugin-rewire-exports -

Published by asapach about 6 years ago

added support for destructured exports, fixes #10

babel-plugin-rewire-exports -

Published by asapach over 6 years ago

babel-plugin-rewire-exports -

Published by asapach over 6 years ago

Upgraded to Babel 7

Package Rankings
Top 2.6% on Npmjs.org
Badges
Extracted from project README
NPM Version NPM Downloads Build Status
Related Projects