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

Transform called CommonJS imports #40

Merged
merged 3 commits into from
May 22, 2017
Merged

Transform called CommonJS imports #40

merged 3 commits into from
May 22, 2017

Conversation

jsnmoon
Copy link
Collaborator

@jsnmoon jsnmoon commented Mar 23, 2017

This adds support for transforming the following:

Before:

var a = require( '...' )( ... );

After:

import aFactory from '...'; 
const a = aFactory( ... );

@jsnmoon jsnmoon changed the title Add handling for called CommonJS imports Transform called CommonJS imports Mar 23, 2017
}
}

function createImport(j, name, source) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question could you not use util.createImportStatement()?

Copy link
Collaborator Author

@jsnmoon jsnmoon Mar 24, 2017

Choose a reason for hiding this comment

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

Yes, you're correct - let me fix this.

@jsnmoon
Copy link
Collaborator Author

jsnmoon commented Mar 24, 2017

@xjamundx: Would it be possible to publish this change for the 1.6.0 release?

@jsnmoon
Copy link
Collaborator Author

jsnmoon commented May 22, 2017

Any chance of merging this PR? The feature branch has been rebased off of master.

(Paging @xjamundx and @gmathieu!)

@xjamundx
Copy link
Contributor

Sorry for missing this. Yes we can get this in.

@xjamundx
Copy link
Contributor

yeah looks good to me

@xjamundx xjamundx merged commit 2af7f4d into 5to6:master May 22, 2017
@jsnmoon jsnmoon deleted the called-imports branch May 22, 2017 18:09
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

Successfully merging this pull request may close these issues.

3 participants