Support parsing import.meta #22861
Labels
Domain: ES Modules
The issue relates to import/export style module behavior
ES Next
New featurers for ECMAScript (a.k.a. ESNext)
Fixed
A PR has been merged for this issue
Suggestion
An idea for TypeScript
Milestone
import.meta
does not parse.import.meta
is stage 3 and implemented in Chrome/V8. See the TC39 proposal here: https://github.com/tc39/proposal-import-metaTypeScript Version: 2.7.0-dev.201xxxxx
Search Terms:
import.meta
Code
Expected behavior:
import.meta
at least parses when output is esnext.For downlevel emit, specific meta-properties like
import.meta.url
, would presumably have to be handled differently. Forimport.meta.url
a project could be given a base URL from which module base URLs are calculated from given their path.Or a custom transform could be used. Any solution requires that
import.meta
parse though.Actual behavior:
Syntax error.
Playground Link:
http://www.typescriptlang.org/play/#src=const%20i%20%3D%20import.meta.url%3B
Related Issues:
The text was updated successfully, but these errors were encountered: