asapach / babel-plugin-rewire-exports

Babel plugin for stubbing [ES6, ES2015] module exports
MIT License
66 stars 7 forks source link

[BUG] Build fails when using export const { foo: bar } = fooBar; #25

Closed grumd closed 4 years ago

grumd commented 4 years ago

Sample repository to reproduce the issue: https://github.com/grumd/babel-plugin-rewire-exports-sample

Steps to reproduce:

  1. Clone it, run npm start, notice the build fails.
  2. Remove rewire-exports from .babelrc, notice the build is successful.

Problem:

const exportObject = { value: 'Test value' };
export const { value: testValue } = exportObject;
// This is supposed to be imported like this:
// import { testValue } from '...';

Stacktrace:

This type of export syntax isn't supported by this plugin and breaks the build process.

grumd commented 4 years ago

Really hope this can get fixed soon because this plugin is a lifesaver :)

sergei-startsev commented 4 years ago

@grumd The provided repo doesn't allow to reproduce the issue, there's neither .babelrc nor rewire-exports in dependencies.

grumd commented 4 years ago

@sergei-startsev Very sorry, I forgot to push one commit. Fixed.

asapach commented 4 years ago

Should be fixed in v2.2.0

grumd commented 4 years ago

@asapach That was incredibly fast, thank you so much!