Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented dead code elimination and updated tests. Fixes #13
I could be missing something in terms of the greater context including
css-modulesify
/css-modules-require-hook
but for the sake of this repo, dead code elimination now works. It is also possible I'm doing something naive, but as far as I can tell everything works.I basically removed the caching that was previously happening, I probably can trivially put back in some caching in the case of composing the same classes from the same file (but not in the case of different classes from the same file). We probably could also make dead code elimination a configuration option and thus optional if you're worried about compile performance (for example during hot loading).
I intend to clean up the tests a little bit and add some more tests (including comprehensive unit tests for the
containsClass
function).This PR contains lint/formatting problems which I intend to fix after #19 is addressed.