Can @babel/types generate statements from source? #11996
Answered
by
JLHwung
shadowtime2000
asked this question in
Q&A
-
Feature Request
Describe the solution you'd like |
Beta Was this translation helpful? Give feedback.
Answered by
JLHwung
Aug 24, 2020
Replies: 1 comment 2 replies
-
Babel supports AST templates in import template from "@babel/template"
const ast = template.ast(`
console.log('It works!')
`); The |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
shadowtime2000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Babel supports AST templates in
@babel/template
The
ast
is then aCallExpression
.