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

Use js-tokens to reduce the size of this dependency #5

Closed
3 tasks done
sheremet-va opened this issue Dec 28, 2023 · 1 comment
Closed
3 tasks done

Use js-tokens to reduce the size of this dependency #5

sheremet-va opened this issue Dec 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sheremet-va
Copy link
Sponsor Contributor

Clear and concise description of the problem

This package uses acorn to parse JS code which is a bit large for the use case.

Suggested solution

I propose using js-tokens instead of acorn to reduce the size of this package. This package is used in Vite and Vitest that both had acorn in dependencies through rollup, but rollup stopped using acorn in the latest major version.

The package itself is much more lightweight, but it relies on a series of regexp manipulations. Still, as far as I understand, it correctly finds commends and multicomments.

Alternative

No response

Additional context

No response

Validations

@sheremet-va sheremet-va added the enhancement New feature or request label Dec 28, 2023
@antfu
Copy link
Owner

antfu commented Dec 28, 2023

Sounds interesting, PR welcome if you want to work on it 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants