Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-sentry-plugin

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-sentry-plugin - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

22

dist/index.js

@@ -27,7 +27,2 @@ 'use strict';

function handleErrors(err, compilation, cb) {
compilation.errors.push('Sentry Plugin: ' + err);
cb();
}
module.exports = function () {

@@ -47,2 +42,3 @@ function SentryPlugin(options) {

this.filenameTransform = options.filenameTransform || DEFAULT_TRANSFORM;
this.suppressErrors = options.suppressErrors;
}

@@ -59,3 +55,3 @@

if (errors) {
return handleErrors(errors, compilation, cb);
return _this.handleErrors(errors, compilation, cb);
}

@@ -70,3 +66,3 @@

}).catch(function (err) {
return handleErrors(err, compilation, cb);
return _this.handleErrors(err, compilation, cb);
});

@@ -76,2 +72,14 @@ });

}, {
key: 'handleErrors',
value: function handleErrors(err, compilation, cb) {
var errorMsg = 'Sentry Plugin: ' + err;
if (this.suppressErrors) {
compilation.warnings.push(errorMsg);
} else {
compilation.errors.push(errorMsg);
}
cb();
}
}, {
key: 'ensureRequiredOptions',

@@ -78,0 +86,0 @@ value: function ensureRequiredOptions() {

{
"name": "webpack-sentry-plugin",
"version": "1.2.0",
"version": "1.3.0",
"description": "Webpack plugin to upload source maps to Sentry",

@@ -14,3 +14,3 @@ "keywords": [

"build": "babel src --out-dir dist",
"prepublish": "npm test && npm run build",
"prepublish": "npm test && npm run lint && npm run build",
"test": "jest",

@@ -17,0 +17,0 @@ "lint": "eslint src test; exit 0"

@@ -25,3 +25,3 @@ # Sentry plugin

```js
var SentryPlugin = require('webpack-sentry-plugin');
var SentryPlugin = require('webpack-sentry-plugin');
```

@@ -34,17 +34,17 @@

```js
var config = {
plugins: [
new SentryPlugin({
// Sentry options are required
organisation: 'your-organisation-name',
project: 'your-project-name',
apiKey: process.env.SENTRY_API_KEY,
// Release version name/hash is required
release: function() {
return process.env.GIT_SHA
}
})
]
}
var config = {
plugins: [
new SentryPlugin({
// Sentry options are required
organisation: 'your-organisation-name',
project: 'your-project-name',
apiKey: process.env.SENTRY_API_KEY,
// Release version name/hash is required
release: function() {
return process.env.GIT_SHA
}
})
]
}
```

@@ -55,28 +55,29 @@

- `exclude`: RegExp to match for excluded files
- `suppressErrors`: Display warnings instead of failing webpack build - useful in case webpack compilation is done during deploy on multiple instances
```js
var config = {
plugins: [
new SentryPlugin({
// Exclude uploading of html
exclude: /\.html$/,
...
})
]
}
```
```js
var config = {
plugins: [
new SentryPlugin({
// Exclude uploading of html
exclude: /\.html$/,
...
})
]
}
```
- `include`: RegExp to match for included files
```js
var config = {
plugins: [
new SentryPlugin({
// Only upload foo.js & foo.js.map
include: /foo.js/,
...
})
]
}
```
```js
var config = {
plugins: [
new SentryPlugin({
// Only upload foo.js & foo.js.map
include: /foo.js/,
...
})
]
}
```
- `filenameTransform`: Function to transform filename before uploading to Sentry

@@ -89,3 +90,3 @@

filenameTransform: function(filename) {
return `a-filename-prefix-${filename}`
return 'a-filename-prefix-' + filename
}

@@ -92,0 +93,0 @@ })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc