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

Parse Re-exporting / Aggregating exports. #42

Open
tcK1 opened this issue Apr 10, 2023 · 1 comment
Open

Parse Re-exporting / Aggregating exports. #42

tcK1 opened this issue Apr 10, 2023 · 1 comment

Comments

@tcK1
Copy link

tcK1 commented Apr 10, 2023

Environment

magicast: 0.2.3
Node: v16.17.0

Reproduction

Codesandbox.

import { parseModule } from "magicast";

const mod = parseModule(`
  export { default as function1, function2 } from "bar.js";
  export { default } from "foo.js";

  export { x } from "mod";
  export { x as v } from "mod";
  export * as ns from "mod";
`);

Describe the bug

Not sure if it's a bug or a feature request, but re-exporting files are not being "indexed" as neither imports nor exports. For reference, es-module-lexer parses them as imports.

I took the examples from MDN.

Additional context

No response

Logs

No response

@zoeyzhao19
Copy link
Contributor

zoeyzhao19 commented Jun 28, 2023

Both mod.import and mod.exports are proxied, If you want to check the output, you would need to wrap it like

console.log(JSON.stringify(mod.imports, null, 2))

But you would still see empty result as magicast does not handle import/export from external resources

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

2 participants