require-error-handler-webpack-plugin
Adds error callback to require.ensure and AMD require calls.
NOTE: Split point error handling was landed in Webpack 2 via
System.import
so I'd strongly advise against using this plugin.
Usage
var requireErrorHandlerPlugin = ;var JsonpMainTemplatePlugin = ; plugins: // `JsonpMainTemplatePlugin` is neccesary as it must be monkey patched. JsonpMainTemplatePlugin
JsonpErrorHandlerPlugin
Adds an error callback to the jsonp transport method that is called when a chunk fails to load.
NOTE: This depends on the JsonpTemplatePlugin
being applied (webpack does this by default given a target of 'web' or 'node-webkit').
RequireEnsureErrorHandlerPlugin
Adds support for the following signatures:
require; require; require; require;
NOTE: This depends on the RequireEnsurePlugin
being applied (webpack does this by default).
AMDRequireErrorHandlerPlugin
Adds support for the following signatures:
; ; ;
NOTE: This depends on the AMDRequirePlugin
being applied (webpack does this by default).
BundleLoader
Adds an error callback to the bundle loader, e.g.
// Supports both immediate and lazy requires.var bundle = ; ;
Todo
- Update
bundle-loader
to support newrequire.ensure
syntax. - Work out how to alias the loader to 'bundle' and carry across query params.
- Add support for default wrapper when chunks are merged
- Add support for named chunks using AMD, i.e. require(name?, deps, successCallback?, errorCallback?)
- Work out how this can occur and support it.
- Remove hacks required to get this to work by potentially requesting changes to webpack to make it easier to hook in.