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

feat: use proxy for top level module #8

Merged
merged 3 commits into from
Feb 16, 2023
Merged

feat: use proxy for top level module #8

merged 3 commits into from
Feb 16, 2023

Conversation

antfu
Copy link
Member

@antfu antfu commented Feb 15, 2023

Changes module node to the proxy so that we can manipulate the exports

@antfu antfu requested a review from pi0 February 16, 2023 11:20
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting more and more exciting :D 🚀

src/proxy/module.ts Show resolved Hide resolved
src/proxy/module.ts Show resolved Hide resolved
return {
$ast: root,
$type: "module",
exports: exportsProxy,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not passing them as second param to createProxy same as others?

Copy link
Member Author

@antfu antfu Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't work as the program root is not a valid node I think. If you want you can give it a try, or we can always refactor it

@pi0 pi0 changed the title feat: able to manipulate exports feat: use proxy for top level module Feb 16, 2023
@pi0 pi0 merged commit b54fdcf into main Feb 16, 2023
@pi0 pi0 deleted the feat/manipulate-exports branch February 16, 2023 11:51
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 this pull request may close these issues.

None yet

2 participants