@sentry/webpack-plugin 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/index.d.ts +1 -0
- package/package.json +3 -2
- package/src/index.js +11 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
- "Would I rather be feared or loved? Easy. Both. I want people to be afraid of how much they love me." — Michael Scott
|
|
4
4
|
|
|
5
|
+
## 1.20.0
|
|
6
|
+
|
|
7
|
+
- build: Bump `@sentry/cli` version to `1.74.6` (#406)
|
|
8
|
+
- feat: Add a means to detect if the CLI binary exists (#402)
|
|
9
|
+
- feat: Add pipeline argument (#403)
|
|
10
|
+
|
|
11
|
+
## 1.19.1
|
|
12
|
+
|
|
13
|
+
- fix(deps): Add `webpack-sources` dependency (#397)
|
|
14
|
+
|
|
5
15
|
## 1.19.0
|
|
6
16
|
|
|
7
17
|
- feat(config): Support reading release from environment (#389)
|
package/index.d.ts
CHANGED
|
@@ -130,6 +130,7 @@ declare namespace SentryCliPlugin {
|
|
|
130
130
|
declare class SentryCliPlugin implements WebpackPluginInstance {
|
|
131
131
|
options: SentryCliPlugin.SentryCliPluginOptions;
|
|
132
132
|
constructor(options: SentryCliPlugin.SentryCliPluginOptions);
|
|
133
|
+
static cliBinaryExists(): string;
|
|
133
134
|
apply(compiler: Compiler): void;
|
|
134
135
|
}
|
|
135
136
|
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"source-map"
|
|
9
9
|
],
|
|
10
10
|
"author": "Sentry",
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.20.0",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": "git@github.com:getsentry/sentry-webpack-plugin.git",
|
|
14
14
|
"homepage": "https://github.com/getsentry/sentry-webpack-plugin",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"node": ">= 8"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@sentry/cli": "^1.74.
|
|
21
|
+
"@sentry/cli": "^1.74.6",
|
|
22
|
+
"webpack-sources": "^2.0.0 || ^3.0.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@types/webpack": "^4.41.31 || ^5.0.0",
|
package/src/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
const SentryCli = require('@sentry/cli');
|
|
2
|
+
const fs = require('fs');
|
|
2
3
|
const path = require('path');
|
|
3
4
|
const util = require('util');
|
|
5
|
+
const { RawSource } = require('webpack-sources');
|
|
6
|
+
const pjson = require('../package.json');
|
|
4
7
|
|
|
5
8
|
const SENTRY_LOADER = path.resolve(__dirname, 'sentry.loader.js');
|
|
6
9
|
const SENTRY_MODULE = path.resolve(__dirname, 'sentry-webpack.module.js');
|
|
7
10
|
|
|
11
|
+
// Set the User-Agent string.
|
|
12
|
+
process.env.SENTRY_PIPELINE = `webpack-plugin/${pjson.version}`;
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
* Helper function that ensures an object key is defined. This mutates target!
|
|
10
16
|
*
|
|
@@ -75,23 +81,11 @@ function attachAfterEmitHook(compiler, callback) {
|
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
function attachAfterCodeGenerationHook(compiler, options) {
|
|
84
|
+
// This is only a problem for folks on webpack 3 and below
|
|
78
85
|
if (!compiler.hooks || !compiler.hooks.make) {
|
|
79
86
|
return;
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
let webpackSources;
|
|
83
|
-
try {
|
|
84
|
-
// eslint-disable-next-line global-require, import/no-extraneous-dependencies
|
|
85
|
-
webpackSources = require('webpack-sources');
|
|
86
|
-
} catch (_e) {
|
|
87
|
-
// eslint-disable-next-line no-console
|
|
88
|
-
console.warn(
|
|
89
|
-
'Coud not resolve package: webpack-sources. Skipping injection for the remote entry file.'
|
|
90
|
-
);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const { RawSource } = webpackSources;
|
|
95
89
|
const moduleFederationPlugin =
|
|
96
90
|
compiler.options &&
|
|
97
91
|
compiler.options.plugins &&
|
|
@@ -204,6 +198,10 @@ class SentryCliPlugin {
|
|
|
204
198
|
return this.options.dryRun === true;
|
|
205
199
|
}
|
|
206
200
|
|
|
201
|
+
static cliBinaryExists() {
|
|
202
|
+
return fs.existsSync(SentryCli.getPath());
|
|
203
|
+
}
|
|
204
|
+
|
|
207
205
|
/** Creates a new Sentry CLI instance. */
|
|
208
206
|
getSentryCli() {
|
|
209
207
|
const cli = new SentryCli(this.options.configFile, {
|