Created
June 22, 2017 12:23
-
-
Save mzbac/a4bb483c03431224c9e7e317e3f44ae8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Press ctrl+space for code completion | |
| export default function transformer(file, api) { | |
| const j = api.jscodeshift; | |
| return j(file.source) | |
| .find(j.CallExpression,{callee: {name: 'require'}}) | |
| .forEach(path => { | |
| console.log(path.value.arguments[0].value); | |
| path.value.arguments[0].value ='test'; | |
| }) | |
| .toSource(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment