Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

napi/parser: expose dynamic import #8369

Open
Boshen opened this issue Jan 9, 2025 · 0 comments
Open

napi/parser: expose dynamic import #8369

Boshen opened this issue Jan 9, 2025 · 0 comments

Comments

@Boshen
Copy link
Member

Boshen commented Jan 9, 2025

          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)

@Boshen Boshen changed the title napi/parse: expose dynamic import napi/parser: expose dynamic import Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant