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

Feature request: star export reporting #76

Open
xiefengnian opened this issue Jun 24, 2021 · 3 comments
Open

Feature request: star export reporting #76

xiefengnian opened this issue Jun 24, 2021 · 3 comments

Comments

@xiefengnian
Copy link

export * from './lib/export/core';

// => imports:["./lib/export/core"] exports:[]
@guybedford
Copy link
Owner

Are you looking to be able to track star exports? This is a feature we could add.

@xiefengnian
Copy link
Author

Are you looking to be able to track star exports? This is a feature we could add.

Yes, that's meant to be an export. it could be :

export * from './lib/export/core';

// => imports:["./lib/export/core"] exports:["./lib/export/core"]

@guybedford
Copy link
Owner

A pattern we use internally in RollupJS is *./lib/export/core as the export name. Perhaps we can take a leaf from that one.

@guybedford guybedford changed the title BUG: 'export * from "foo";' dose not recognize to exports but imports Feature request: star export reporting Oct 1, 2021
Boshen added a commit to oxc-project/oxc that referenced this issue Mar 9, 2024
# Oxc Module Lexer

This is not a lexer. The name "lexer" is used for easier recognition.

## [es-module-lexer](https://github.com/guybedford/es-module-lexer)

Outputs the list of exports and locations of import specifiers,
including dynamic import and import meta handling.

Does not have any
[limitations](https://github.com/guybedford/es-module-lexer?tab=readme-ov-file#limitations)
mentioned in `es-module-lexer`.

I'll also work on the following cases to make this feature complete.

- [ ] get imported variables
guybedford/es-module-lexer#163
- [ ] track star exports as imports as well
guybedford/es-module-lexer#76
- [ ] TypeScript specific syntax
- [ ] TypeScript `type` import / export keyword

## [cjs-module-lexer](https://github.com/nodejs/cjs-module-lexer)

- [ ] TODO

## Benchmark

This is 2 times slower than `es-module-lexer`, but will be significantly
faster when TypeScript is processed.

The difference is around 10ms vs 20ms on a large file (700k).
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