@sentry/webpack-plugin 1.18.4 → 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,11 @@
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
+
8
13
  ## v1.18.4
9
14
 
10
15
  - deps: Bump sentry-cli to 1.72.0
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "source-map"
9
9
  ],
10
10
  "author": "Sentry",
11
- "version": "1.18.4",
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",
@@ -20,6 +20,9 @@
20
20
  "dependencies": {
21
21
  "@sentry/cli": "^1.72.0"
22
22
  },
23
+ "peerDependencies": {
24
+ "webpack": "^4.41.31 || ^5.0.0"
25
+ },
23
26
  "devDependencies": {
24
27
  "@types/webpack": "^4.41.31 || ^5.0.0",
25
28
  "codecov": "^3.5.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();