-
-
-
Happy to help :)
-
trying to split up ES6 modules using these tools. one file, many exports -> many files with one export. Know of any examples of this kind of refactor? most examples are one file -> one file
-
Take the one file, convert to ast, write jscodeshift filters to separate each export to its own ast. Take each of the export ast and use recast's toSource() to prettify and then write to separate files.
-
Something like this AFAIK. Havent worked with jscodeshift for sometime now. Happy to look at some code to help better.pic.twitter.com/T4RwNrebr9
-
Thanks! Some very early results: https://github.com/southpolesteve/esm-refactor/blob/master/index.js#L14-L39 … We'll see where this goes...
-
AST stuff is always a bit ugly, with at(0) lookups and stuff. But looks like you're on the right track. As far as I understand, now you've to implement the actual filter transform which will put the export code into the files you've created.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.