export default myplugin = ({ type:t }) => {
let visitor = {
stringLiteral ( path ) {
asyncfn(path, result =>{
// do something async
// how can i get these async result into ast tree?
})
}
}
return {
visitor
}
}
https://github.com/babel/babel.github.io/issues/762
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
如果需要异步转同步,Promise、Generator 和 Async 不是很好的解决方案么?
不知下面的代码是否对你有用。