-
Notifications
You must be signed in to change notification settings - Fork 29
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 section "return multiple nodes" #4
Add section "return multiple nodes" #4
Conversation
// If it is a expression statement, | ||
if (ts.isExpressionStatement(node)) { | ||
// Clone it | ||
const newNode = ts.getMutableClone(node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
watch out for this - ts-loader
doesn't play nicely (theres a section at the bottom of the handbook that mentions this). only found this out yesterday hehe
could you re-do this with either updateExpressionStatement or just returning the node twice?
[node, node]
love it, just the one comment |
Done. I hope ts-loader supports it well in the future. Although it works here, little concerned with moving a node around without cloning as it contains reference to its position in the source file and such. |
Part of #2.
Added doc and example.