Add support for split point error handling#785
Add support for split point error handling#785richardscarrott wants to merge 9 commits intowebpack:masterfrom
Conversation
|
I've fixed up a few issues, updated the bundle loader and moved this out into a separate plugin repo: https://github.com/richardscarrott/require-error-handler-webpack-plugin so it can be used as is. It's still not ideal and personally I think the best solution would be to have error handling supported by default in webpack (as it adds minimal bootstrap code) rather than having to dupe so much logic in a plugin; it feels to me error handling is vital to being able to use split points in production... |
|
I still have this in mind and it will eventually be merged into the webpack-2 branch. ES6 adds |
|
Great! If you need any help let me know. |
|
@sokra will there be way to use it without |
There was a problem hiding this comment.
Is here a reason why you do not check readyState for readystatechange event? before calling onComplete?
There was a problem hiding this comment.
To avoid buggy implementations of onreadystatechange in old IE (I think less than 9). It worked out nicely because webpack is already using a jsonp style callback so I just check whether it is actually installed to determine if an error has occurred.
|
@sokra @richardscarrott |
Usage
JsonpErrorHandlerPlugin
Adds an error callback to the jsonp transport method that is called when a chunk fails to load.
RequireEnsureErrorHandlerPlugin
Adds support for the following signatures:
AMDRequireErrorHandlerPlugin
Adds support for the following signatures:
This has been working well for me however there were a few areas which were difficult to hook into, in particular, the
JsonpMainTemplatePluginand the code is far from perfect at the moment so it'd be good to get some pointers.