-
Notifications
You must be signed in to change notification settings - Fork 19
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(svelte): option to warn on unused classes #703
Conversation
Deploy preview for m-css failed. Built with commit ccfce2b https://app.netlify.com/sites/m-css/deploys/5e1186e591098d0008699b22 |
ec382cc
to
c934133
Compare
Codecov Report
@@ Coverage Diff @@
## master #703 +/- ##
=========================================
- Coverage 98.45% 98.2% -0.26%
=========================================
Files 45 46 +1
Lines 1168 1224 +56
Branches 181 190 +9
=========================================
+ Hits 1150 1202 +52
- Misses 15 19 +4
Partials 3 3
Continue to review full report at Codecov.
|
I got a chance to run this on a real codebase this morning and... yikes. It's way, way too naive to actually use in this form. Probably needs to be implemented as a method on the |
This version might be better, it's certainly the "more holistic" approach I mentioned previously. Will run it on real code tomorrow and see how scary things look. |
Mostly so it's more useful in the processor
Walk each selector's depgraph now to ensure dependencies are marked as used correctly. Also adjusted invalidation logic so reprocessing only happens if the file is invalidated AND the contents changed.
Not once per bundle, yikes
Not even gonna bother with that right now.
Still kinda basic, but better.
Moved functionality into processor
Also sneak in a deferred, my favorite.
Simplifies things a little bit
To help keep me more sane, in theory!
Also make relative helper accept single files
Still need to add that missing rollup test, and probably docs. |
Too far out of date to be useful, I suspect. |
Description
This adds a new option to
@modular-css/svelte
,warnOnUnused
. When set totrue
this will cause warnings to be issued for all the classes within the processed<link>
or<style>
that don't appear somewhere in the template code.Motivation and Context
Fixes #702
How Has This Been Tested?
Added tests in the PR.
Types of changes
Checklist: