guybedford / es-module-lexer

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

Finds "import.meta.vitest" but defines import as undefined #152

Open MathiasWP opened 1 year ago

MathiasWP commented 1 year ago

Is this expected behaviour?

guybedford commented 1 year ago

Yes, this is by design - import.meta is detected as having a import.d === -2 value, and offsets are provided, but parsing of properties must be handled manually due to es-module-lexer not including an expression or property parser.