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

Add option for noInterop #57

Merged
merged 1 commit into from
Aug 28, 2018
Merged

Add option for noInterop #57

merged 1 commit into from
Aug 28, 2018

Conversation

vikr01
Copy link
Contributor

@vikr01 vikr01 commented Aug 5, 2018

Similar to babel-plugin-transform-es2015-modules-commonjs, allows the user to specify an option for noInterop.

.babelrc

{
  "plugins": [
    ["dynamic-import-node", {"noInterop": true}]
  ]
}

In:

(async()=>{
  const foo = await import('foo');
})()

Out:

(async () => {
  const foo = await Promise.resolve().then(() => require('foo'));
})();

Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this seems fine - but can you also add test cases for it?

@vikr01
Copy link
Contributor Author

vikr01 commented Aug 6, 2018

I've added some test cases. Copied all of the expected.js files and removed the interopRequireWildcard.

@ljharb ljharb merged commit 76064ff into airbnb:master Aug 28, 2018
@vikr01 vikr01 mentioned this pull request Oct 26, 2018
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.

None yet

2 participants