Add options to control composed output #21
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.
Fixes #19
Whilst I take on board the recommendation to propose this to the css modules spec (and have done so in css-modules/css-modules#417), there really isn't really much activity going on there, even when @devongovett makes suggestions for extensions.
So, I raise this PR as a POC based on a patch I've applied locally to unlock my own project to demonstrate how it might work in practice.
I'm well aware it's missing some implementation details (composing an already composed class from another file doesn't work yet), but I just wanted to put this up.
edit: added support for composing composed classes from another file. I think it would be a lot easier to handle all classes as arrays until the last possible moment and then join them to strings only when required, but that would be a more substantial rewrite - ie, remove the join from here:
vite-css-modules/src/plugin/index.ts
Line 210 in 9b7c639