-
-
Notifications
You must be signed in to change notification settings - Fork 597
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 resultHook
(options.resultHook
)
#684
Conversation
When resultHook is passed with the query, css-loader will call it with the loader context and the result. It will allow extending css-loader functionality without using a fork. For instance, it will be possible to generate TypeScript typing files on the fly.
resultHook
(options.resultHook
)
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.
Sry, but I have to decline this, it's out-of-scope for this loader to support specific use cases or libraries
Well, it's sad to hear. Any alternatives to achieve that? |
Why don't parse output here https://github.com/webpack-contrib/css-loader/blob/master/lib/loader.js#L135 ? |
@evilebottnawi are you suggest to eval css-loader's output? I can see how this could help but I'm afraid there are will be too many corner cases to make it stable. |
@kossnocorp look here in theory we can use |
@evilebottnawi having Also, @michael-ciniawsky WDYT? |
@kossnocorp no docs 😄 Yep, for pass own data from loader to other loader |
@michael-ciniawsky what do you think, won't it be out of scope? |
😬 |
When resultHook is passed with the query, css-loader will call it with the loader context and the result. It will allow extending css-loader functionality without using a fork. For instance, it will be possible to generate TypeScript typing files on the fly.
What kind of change does this PR introduce?
This PR introduces a feature.
Did you add tests for your changes?
Yes.
If relevant, did you update the README?
Yes.
Summary
I want to add TypeScript support to decss. To do so I have to generate type definition files. I can't do it via additional loader as I need an access to raw exports object.
Does this PR introduce a breaking change?
Nope.
Other information
¯\(ツ)/¯