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

[inject] doesn't transform references in object destructuring #1235

Closed
eight04 opened this issue Aug 8, 2022 · 2 comments
Closed

[inject] doesn't transform references in object destructuring #1235

eight04 opened this issue Aug 8, 2022 · 2 comments

Comments

@eight04
Copy link
Contributor

eight04 commented Aug 8, 2022

  • Rollup Plugin Name: inject
  • Rollup Plugin Version: 4.0.4
  • Rollup Version: 2.77.2
  • Operating System (or Browser): Windows 10
  • Node Version: 17.4.0
  • Link to reproduction (⚠️ read below):

Repro: https://github.com/eight04/node-test/tree/rollup-inject-object-destruct
source

export const foo = ({cwd = process.cwd()}) => {
  console.log(cwd);
};

config

inject({
  process: require.resolve("./shim/process")
})

Expected Behavior

The shim file should be included in the bundle.

Actual Behavior

The shim file was not included in the bundle.

Additional Information

It works fine if we don't use object destructuring:

export const foo = (cwd = process.cwd()) => {
  console.log(cwd);
};
@stale
Copy link

stale bot commented Oct 14, 2022

Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

@stale stale bot closed this as completed Oct 14, 2022
@eight04
Copy link
Contributor Author

eight04 commented Oct 14, 2022

There is already a PR: #1241

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

No branches or pull requests

1 participant