-
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: add rollup option to export styles #453
Conversation
Codecov Report
@@ Coverage Diff @@
## master #453 +/- ##
==========================================
+ Coverage 99% 99.01% +0.01%
==========================================
Files 31 31
Lines 800 810 +10
Branches 124 128 +4
==========================================
+ Hits 792 802 +10
Misses 8 8
Continue to review full report at Codecov.
|
On my phone but this looks like a good start! I'll investigate the source map issue a bit, hopefully it's straightforward. |
If the configuration Depending on how far you want to go with protecting users from their own mistakes, I think an implementation solution could lie in conditional defaults. Meaning, e.g. if |
Also a bunch of 🔒 updates
Yeah, if you define
Because none of those really make sense in this context. |
… into morewry-pr/styleExport
- Disables source maps if they aren't explicitly requested - Disables file emitting - Warns if using done hook since it'll never be called
Ugh, sorry. Screwed up by accidentally merging master into your pr branch. It should still land fine, the history in this PR is just uglier than necessary. Gonna see if I can fix it... |
Hey @morewry, TravisCI finished with status |
FYI, I have on my list to iterate on the rest of the behavior changes within the next few days. |
@morewry I added all the ones mentioned in #453 (comment) in commit 4b67b7b, are there others? |
Oh! I missed that! Awesome, no, that looks like everything. Thank you so much! |
See #451 for more information.
This pull request adds a
styleExport
option tomodular-css-rollup
that will add an additional ES Moduleexport
of each CSS Module's styles for CSS-in-JS approaches that may need the style contents instead of or in addition to class names and values.One specific example is gaining true style scoping by using Shadow DOM where only styles within the shadow tree will apply to the elements in the shadow tree. Making the styles available in scripts allows a developer to embed the styles as a templated part of each Web Component instance.