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

fix(inject): isReference check bug #804

Merged
merged 4 commits into from
Apr 22, 2021
Merged

Conversation

linsk1998
Copy link
Contributor

@linsk1998 linsk1998 commented Feb 14, 2021

Rollup Plugin Name: inject

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

disregard the bar in import { bar as foo }

For example

If my config inject "bar", the following code

import { bar as foo } from 'bar2'
console.log(bar);

will transfrom to the following code

import bar from 'bar';
import { bar as foo } from 'bar2';
console.log(bar);

.

But expect will not inject.

@shellscape
Copy link
Collaborator

Please provide a detailed description of why this change is necessary, and any relevant issue numbers. (If there isn't an issue associated with this PR, you'll have to provide a good amount of information about the problem you were trying to solve.)

@linsk1998 linsk1998 changed the title fix(inject): disregard the bar in import { bar as foo } fix(inject): isReference check bug Feb 15, 2021
@danielgindi
Copy link
Contributor

Is there ANY description of what this is about?

@linsk1998
Copy link
Contributor Author

@danielgindi @shellscape I add more description.

@shellscape
Copy link
Collaborator

@danielgindi how's that update to the PR description look for you?

@danielgindi
Copy link
Contributor

@danielgindi how's that update to the PR description look for you?

Not the best, but getting there. If I understand correctly, there's a situation where an import is not flagged correctly and it causes duplicate imports in the output, resulting in a syntax error.
Am I right?

@shellscape
Copy link
Collaborator

@danielgindi I believe that's correct. Going to move this one forward.

@shellscape shellscape merged commit cc5a14f into rollup:master Apr 22, 2021
guybedford pushed a commit that referenced this pull request Apr 30, 2021
* disregard the `bar` in `import { bar as foo }

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

Successfully merging this pull request may close these issues.

5 participants