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] Support custom runner script to exercise the JavaScript code #442

Open
aminya opened this issue Oct 13, 2020 · 0 comments
Open

Comments

@aminya
Copy link
Contributor

aminya commented Oct 13, 2020

According to readme:

UnCSS only runs the Javascript that is run on page load. It does not (and cannot) handle Javascript that runs on user interactions like button clicks. You must use the ignore option to preserve classes that are added by Javascript on user interaction.

If we can provide an option to allow the user to specify a certain script that exercises the JavaScript code, we can remove this limitation. For example, they can write a script to click that button.

Here is a tool by @toshi1127 which uses puppeteer's coverage feature to remove unused css. If we can integrate these two projects together, we can get very good results!
https://github.com/toshi1127/css-optimization

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

1 participant