-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Allow custom modules.getJSON
function
#132
Conversation
Codecov Report
@@ Coverage Diff @@
## master #132 +/- ##
==========================================
+ Coverage 95.1% 95.14% +0.03%
==========================================
Files 8 8
Lines 245 247 +2
Branches 84 85 +1
==========================================
+ Hits 233 235 +2
Misses 12 12
Continue to review full report at Codecov.
|
Hey @egoist, sorry for ping, but have you had a chance to look at this? Thanks! |
duplicate of #127 |
Ah, yes @flying-sheep. If you take the test updates from here, I'll close this. I would also ensure that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, since your PR is farther along, you could also just do this and i’ll close mine 😄
src/postcss-loader.js
Outdated
modulesExported[filepath] = json | ||
if (typeof options.modules === 'object' && typeof options.modules.getJSON === 'function') { | ||
options.modules.getJSON(filepath, json, outpath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getJSON
may be an async
function, so you need to return options.modules.getJSON(...)
here.
Hi guys, What do you guys think? |
that’s not how getJSON works, it would be confusing. there could be another option though… |
Another option sounds good |
Thanks for merging this @egoist! Look forward to the next release. |
@benkeen check out 2.0.0 🤗 |
Hey~! As of now, there's no way to access the JSON file of classnames to their outputs. It can only happen thru the [`getJSON` method of `postcss-modules`](https://github.com/css-modules/postcss-modules#saving-exported-classes), but it's overridden here. This PR allows a user to define a custom `getJSON` method, passing it all arguments for them to do as they please. It does not affect the core behavior of the plugin. --- _Also closes #101_
Hey~!
As of now, there's no way to access the JSON file of classnames to their outputs. It can only happen thru the
getJSON
method ofpostcss-modules
, but it's overridden here.This PR allows a user to define a custom
getJSON
method, passing it all arguments for them to do as they please. It does not affect the core behavior of the plugin.Also closes #101