Skip to content

napi/parser: expose dynamic import #8369

@Boshen

Description

@Boshen
          Were dynamic imports with string literal specifiers omitted intentionally? I expected to see `dynamicImports` on `EcmaScriptModule` alongside `staticImports` to get the previously supported data. A workaround is just crawling the AST yourself:

import('dynamic_import')

{
  "type": "ImportExpression",
  "start": 0,
  "end": 24,
  "source": {
    "type": "Literal",
    "start": 7,
    "end": 23,
    "value": "dynamic_import",
    "raw": "'dynamic_import'"
  },
  "arguments": [],
  "phase": null
}

Originally posted by @ryanatkn in #7788 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions