@sentry/webpack-plugin 1.19.0 → 1.19.1

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
@@ -2,6 +2,10 @@
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.19.1
6
+
7
+ - fix(deps): Add `webpack-sources` dependency (#397)
8
+
5
9
  ## 1.19.0
6
10
 
7
11
  - feat(config): Support reading release from environment (#389)
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "source-map"
9
9
  ],
10
10
  "author": "Sentry",
11
- "version": "1.19.0",
11
+ "version": "1.19.1",
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.4"
21
+ "@sentry/cli": "^1.74.4",
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,6 +1,7 @@
1
1
  const SentryCli = require('@sentry/cli');
2
2
  const path = require('path');
3
3
  const util = require('util');
4
+ const { RawSource } = require('webpack-sources');
4
5
 
5
6
  const SENTRY_LOADER = path.resolve(__dirname, 'sentry.loader.js');
6
7
  const SENTRY_MODULE = path.resolve(__dirname, 'sentry-webpack.module.js');
@@ -75,23 +76,11 @@ function attachAfterEmitHook(compiler, callback) {
75
76
  }
76
77
 
77
78
  function attachAfterCodeGenerationHook(compiler, options) {
79
+ // This is only a problem for folks on webpack 3 and below
78
80
  if (!compiler.hooks || !compiler.hooks.make) {
79
81
  return;
80
82
  }
81
83
 
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
84
  const moduleFederationPlugin =
96
85
  compiler.options &&
97
86
  compiler.options.plugins &&