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

Closed
Boshen opened this issue Jan 9, 2025 · 0 comments · Fixed by #8540
Closed

napi/parser: expose dynamic import #8369

Boshen opened this issue Jan 9, 2025 · 0 comments · Fixed by #8540
Assignees

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
@Boshen Boshen self-assigned this Jan 12, 2025
@Boshen Boshen closed this as completed in c479a58 Jan 16, 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

Successfully merging a pull request may close this issue.

1 participant