@sentry/webpack-plugin 1.18.1 → 1.18.5

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 CHANGED
@@ -5,6 +5,25 @@
5
5
  - "Would I rather be feared or loved? Easy. Both. I want people to be afraid of
6
6
  how much they love me." — Michael Scott
7
7
 
8
+ ## v1.18.5
9
+
10
+ - fix: Check if `rawSource` is available before use (#347)
11
+ - deps: Add Webpack as a peerDependency (#343)
12
+
13
+ ## v1.18.4
14
+
15
+ - deps: Bump sentry-cli to 1.72.0
16
+ - ref: Use `var` instead of `const` for module loader for ES5-compat (#338)
17
+
18
+ ## v1.18.3
19
+
20
+ - types: Fix typo in vcsRemote config option (#327)
21
+ - deps: Bump sentry-cli to 1.70.1 (#327)
22
+
23
+ ## v1.18.2
24
+
25
+ - deps: Update sentry-cli to v1.70
26
+
8
27
  ## v1.18.1
9
28
 
10
29
  - fix: Reexport `SourceMapsPathDescriptor` type (#323)
package/README.md CHANGED
@@ -65,6 +65,7 @@ Also, check the [example](example) directory.
65
65
  | project | `string` | optional | The slug of the Sentry project associated with the app. |
66
66
  | authToken | `string` | optional | The authentication token to use for all communication with Sentry. Can be obtained from https://sentry.io/settings/account/api/auth-tokens/. Required scopes: `project:releases` (and `org:read` if `setCommits` option is used). |
67
67
  | url | `string` | optional | The base URL of your Sentry instance. Defaults to https://sentry.io/, which is the correct value for SAAS customers. |
68
+ | customHeader | `string` | optional | A header added to all outgoing requests. A string in the format `header-key: header-value` |
68
69
  | vcsRemote | `string` | optional | The name of the remote in the version control system. Defaults to `origin`. |
69
70
  | release | `string` | optional | Unique identifier for the release. Defaults to the output of the `sentry-cli releases propose-version` command, which automatically detects values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses `HEAD`'s commit SHA. (**For `HEAD` option, requires access to `git` CLI and for the root directory to be a valid repository**). |
70
71
  | dist | `string` | optional | Unique identifier for the distribution, used to further segment your release. Usually your build number. |
package/index.d.ts CHANGED
@@ -15,9 +15,10 @@ declare namespace SentryCliPlugin {
15
15
  | 'authToken'
16
16
  | 'org'
17
17
  | 'project'
18
- | 'vscRemote'
18
+ | 'vcsRemote'
19
19
  | 'dist'
20
20
  | 'silent'
21
+ | 'customHeader'
21
22
  >,
22
23
  Pick<
23
24
  SentryCliUploadSourceMapsOptions,
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "source-map"
9
9
  ],
10
10
  "author": "Sentry",
11
- "version": "1.18.1",
11
+ "version": "1.18.5",
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,10 @@
18
18
  "node": ">= 8"
19
19
  },
20
20
  "dependencies": {
21
- "@sentry/cli": "^1.68.0"
21
+ "@sentry/cli": "^1.72.0"
22
+ },
23
+ "peerDependencies": {
24
+ "webpack": "^4.41.31 || ^5.0.0"
22
25
  },
23
26
  "devDependencies": {
24
27
  "@types/webpack": "^4.41.31 || ^5.0.0",
package/src/index.js CHANGED
@@ -108,23 +108,29 @@ function attachAfterCodeGenerationHook(compiler, options) {
108
108
  compilation.hooks.afterCodeGeneration.tap('SentryCliPlugin', () => {
109
109
  compilation.modules.forEach(module => {
110
110
  // eslint-disable-next-line no-underscore-dangle
111
- if (module._name !== moduleFederationPlugin._options.name) return;
111
+ if (module._name !== moduleFederationPlugin._options.name) {
112
+ return;
113
+ }
114
+
112
115
  const sourceMap = compilation.codeGenerationResults.get(module)
113
116
  .sources;
114
117
  const rawSource = sourceMap.get('javascript');
115
- sourceMap.set(
116
- 'javascript',
117
- new RawSource(
118
- `${rawSource.source()}
119
- (function (){
120
- var globalThis = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {});
121
- globalThis.SENTRY_RELEASES = globalThis.SENTRY_RELEASES || {};
122
- globalThis.SENTRY_RELEASES["${options.project}@${
123
- options.org
124
- }"] = {"id":"${version}"};
125
- })();`
126
- )
127
- );
118
+
119
+ if (rawSource) {
120
+ sourceMap.set(
121
+ 'javascript',
122
+ new RawSource(
123
+ `${rawSource.source()}
124
+ (function (){
125
+ var globalThis = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {});
126
+ globalThis.SENTRY_RELEASES = globalThis.SENTRY_RELEASES || {};
127
+ globalThis.SENTRY_RELEASES["${options.project}@${
128
+ options.org
129
+ }"] = {"id":"${version}"};
130
+ })();`
131
+ )
132
+ );
133
+ }
128
134
  });
129
135
  });
130
136
  cb();
@@ -2,7 +2,7 @@ module.exports = function sentryLoader(content, map, meta) {
2
2
  const { releasePromise, org, project } = this.query;
3
3
  const callback = this.async();
4
4
  releasePromise.then(version => {
5
- let sentryRelease = `const _global = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}); _global.SENTRY_RELEASE={id:"${version}"};`;
5
+ let sentryRelease = `var _global = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}); _global.SENTRY_RELEASE={id:"${version}"};`;
6
6
  if (project) {
7
7
  const key = org ? `${project}@${org}` : project;
8
8
  sentryRelease += `