Webpack's Error Reporting Plugin
This webpack plugin will do a POST call to any given URL every time webpack find an error.
This plugin is fully compatible with:
Installation
$ npm install bc-webpack-error-reporting-plugin --save-dev
Sample Configuration
Add the following configuration into your webpack plugins
const WebpackErrorReporting = require("@breathecode/webpack-error-reporting-plugin");
plugins: [
new WebpackErrorReporting({
hookURL: 'https://path/to/url/hook',
username: 'alesanchezr',
token: 'Bearer sdSSDFwefEWFewrfewr43234FSD34r',
silent: true
}),
]
Sample Request with Errors Found
This is an example of the request body that can be sent to your HOOK backend API.
[
{
"message":"Module not found ./component/homee.js",
"file":"./src/js/index.js",
"username": "bobdylan",
"origin":"\n @ ./src/js/index.js 9:0-44 11:36-40\n @ multi ./src/js/index.js",
"name":"Module not found",
"severity":900,
"type":"module-not-found",
"module":"./component/homee.js",
"slug":"webpack_error",
"details":"ModuleNotFoundError: Module not found: Error: Can't resolve './component/homee.js' in '/workspace/webpack-reporting-plugin/_sandbox/src/js'"
}
]