Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
webpack-bugsnag-plugins
Advanced tools
Webpack plugins for common Bugsnag actions.
npm install --save-dev webpack-bugsnag-plugins
new BugsnagBuildReporterPlugin(build, opts):
WebpackPlugin
const { BugsnagBuildReporterPlugin } = require('webpack-bugsnag-plugins')
Reports your application's build to Bugsnag. It can auto detect source control from .git
, .hg
and package.json
.
This plugin hooks into the 'after-emit'
event once all output files have been generated by the Webpack compiler. If anything causes the compilation to fail before this step, the build report will not get sent.
build
describes the build you are reporting to Bugsnag
apiKey: string
your Bugsnag API key [required]appVersion: string
the version of the application you are building [required]releaseStage: string
'production'
, 'staging'
etc. (leave blank if this build can be released to different releaseStage
s)sourceControl: object
an object describing the source control of the build (if not specified, the module will attempt to detect source control information from .git
, .hg
and the nearest package.json
)
provider: string
can be one of: 'github'
, 'github-enterprise'
, 'gitlab'
, 'gitlab-onpremise'
, 'bitbucket'
, 'bitbucket-server'
repository: string
a URL (git
/ssh
/https
) pointing to the repository, or webpage representing the repositoryrevision: string
the unique identifier for the commit (e.g. git SHA)builderName: string
the name of the person/machine that created this build (defaults to the result of the whoami
command)autoAssignRelease: boolean
automatically associate this build with any new error events and sessions that are received for the releaseStage
until a subsequent build notification is received. If this is set to true
and no releaseStage
is provided the build will be applied to 'production'
.opts
logLevel: string
the minimum severity of log to output ('debug'
, 'info'
, 'warn'
, 'error'
), default 'warn'
logger: object
provide a different logger object { debug, info, warn, error }
path: string
the path to search for source control info, defaults to process.cwd()
endpoint: string
post the build payload to a URL other than the default (https://build.bugsnag.com
)const { BugsnagBuildReporterPlugin } = require('webpack-bugsnag-plugins')
module.exports = {
entry: './app.js',
output: {
path: __dirname,
filename: './bundle.js'
},
plugins: [].concat(
// It's a good idea to only run this plugin when you're building a bundle
// that will be released, rather than for every development build
isDistEnv
? new BugsnagBuildReporterPlugin({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3'
}, { /* opts */ })
: []
)
}
new BugsnagSourceMapUploaderPlugin(opts):
WebpackPlugin
const { BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins')
Upload your application's sourcemap(s) to Bugsnag. When Webpack is done producing output, this plugin detects sourcemaps for any output chunks and uploads them to Bugsnag.
opts
provide options to the sourcemap uploader
apiKey: string
your Bugsnag API key [required]publicPath: string
the path to your bundled assets (as the browser will see them). This option must either be provided here, or as output.publicPath
in your Webpack config.appVersion: string
the version of the application you are building (defaults to the version
set in your project's package.json file, if one is specified there)codeBundleId: string
the codeBundleId (e.g. for NativeScript projects)overwrite: boolean
whether you want to overwrite previously uploaded sourcemapsendpoint: string
post the build payload to a URL other than the default (https://upload.bugsnag.com
)ignoredBundleExtensions: string[]
a list of bundle file extensions which shouldn't be uploaded (default [ '.css' ]
)const { BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins')
module.exports = {
entry: './app.js',
devtool: 'source-map',
output: {
path: __dirname,
filename: './bundle.js',
publicPath: 'https://your-app.xyz/assets/'
},
plugins: [].concat(
// It's a good idea to only run this plugin when you're building a bundle
// that will be released, rather than for every development build
isDistEnv
? new BugsnagSourceMapUploaderPlugin({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3'
})
: []
)
}
These plugins have been tested with webpack versions 3, 4 and 5.
All contributors are welcome! See our contributing guide.
This module is free software released under the MIT License. See LICENSE.txt for details.
1.8.0 (2021-07-07)
FAQs
Webpack plugins for common Bugsnag actions
The npm package webpack-bugsnag-plugins receives a total of 70,099 weekly downloads. As such, webpack-bugsnag-plugins popularity was classified as popular.
We found that webpack-bugsnag-plugins demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.