Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable collision after export * #1550

Closed
tony-g opened this issue Aug 13, 2017 · 1 comment
Closed

Variable collision after export * #1550

tony-g opened this issue Aug 13, 2017 · 1 comment

Comments

@tony-g
Copy link

tony-g commented Aug 13, 2017

I'm running into a variable not getting renamed and colliding with an import. I'm not sure if I'm missing a plugin or setting (or otherwise doing something I shouldn't be), or if it might be a bug.

Here's a repo with a full example. https://github.com/tony-g/rollup-export-star-question

...

I have a react/redux project and have folders for actions, reducers, selectors, etc.

selectors/index.js looks like this:

export * from './a'
export * from './b'
export * from './calculation'

I import them in another file (src/doesnt-work.js in the example)

import { calculation as doCalculation } from './selectors/index'
...
function mapStateCulprit(state) {
  const calculation = doCalculation(...)
  ...
}

Expected

calculation is renamed (which is what happens if I import it directly from ./selectors/calculation)

function mapState(state) {
  const calculation$$1 = calculation();

Actual

It's not renamed and I get this: (which breaks)

...
function mapStateCulprit(state, ownProps) {
  const calculation = calculation(state);
...

Thanks for your help!

Rich-Harris added a commit that referenced this issue Aug 13, 2017
Rich-Harris added a commit that referenced this issue Aug 13, 2017
@Rich-Harris
Copy link
Contributor

Fixed in 0.47.3, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants