thx / gogocode

GoGoCode is a transformer for JavaScript/Typescript/HTML based on AST but providing a more intuitive API.
MIT License
5.61k stars 425 forks source link

gogocode 无法解析 import.meta.env.DEV 这段代码,但是 AST 解析是正常的 #145

Closed carl-jin closed 2 years ago

carl-jin commented 2 years ago

import.meta.env.DEV 这是 vite 里面使用的环境变量,但是放到 playground 里面却报错,注意左下角的 AST 解析树是正常的。

shuerguo999 commented 2 years ago

需要设置parseOptions https://play.gogocode.io/#code/N4IglgdgDgrgLgYQPYBMCmIBc4C2UkBOcAdDmnAIbFoQBuxAIgKIBqA3CADQgDuhA1snRYQAMxgQAxnDBIIAAjgEKEAM6jCOABSiwAGzQBJCBs7yKUMGaRQZc1QEp5wADoL5k+3HkASeQF5zS2IAcyQwz3Q3eQ8veVUkGAJJNAD5XQNjDWIEpJTo+QB6QvkCciSFAE9EgkVlNQ0CMhRY9HkACzQygrK4Ct8tXOS0M1d3GKgKAlU0AHlbWTVMZ3ialIAVSqg0ZYByHFQYA135AF8C04diMqg9ChStXc81bwo0nwB9H12zJ7i3wIAJl2VxCNC6FDgaC0Djc5wgXHA0HgABkVCERHAtmhVJICGBbIj2hRVAAFXoyLpYJQwEYgVQwABGLDAaB4m22mLKGFOQA