guybedford / es-module-lexer

Low-overhead lexer dedicated to ES module parsing for fast analysis
MIT License
933 stars 48 forks source link

Parse error for import.meta.env #142

Closed IanVS closed 2 years ago

IanVS commented 2 years ago

We are using this package in storybook's vite builder, and found that we get a parse error for expressions like import.meta.env.STORYBOOK_ENV, which is the syntax that vite uses for environment variables.

guybedford commented 2 years ago

@IanVS can you please share an exact test case here for what is not parsing?

I just tried parse('import.meta.env.STORY_BOOK_ENV') and this is working fine for me.

IanVS commented 2 years ago

Thanks for taking a look. I was hoping it would be something clear cut, but I guess not. I'll dig in and let you know what I find.

IanVS commented 2 years ago

Sorry for the noise, this turned out to be an issue on our end.