guybedford / es-module-lexer

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

Parse error for import.meta.env #142

Closed IanVS closed 1 year ago

IanVS commented 1 year 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 1 year 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 1 year 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 1 year ago

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