Expose original 'done' callback to the custom callback.#61
Open
modax wants to merge 1 commit intoshama:masterfrom
Open
Expose original 'done' callback to the custom callback.#61modax wants to merge 1 commit intoshama:masterfrom
modax wants to merge 1 commit intoshama:masterfrom
Conversation
This can be done via this.webpackDone in the custom callback.
Owner
|
Thanks for the PR! I don't want to take the user's context over though in the done function. I think it would be better just as a separate method: webpack({}, null, function (err, stats) {
webpack.logStats(err, stats)
// Do other stuff
}) |
|
I think that would be super useful. In my case, I'm trying to get compilation errors in the stats object, and I want to throw an error and stop the compilation if that happens. This is the case if a module is not found, compilation still happens, but webpack outputs the error. It would be great to do something like this inside the done function:
Currently I'm not sure how to stop the stream at that point |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This can be done via this.webpackDone in the custom callback. Since original callback needs
optionsand accessescallingDonein the parent context, in my opinion, it is better to be kept as instance method accessible viathis.