@sentry/webpack-plugin 2.1.0 → 2.2.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/dist/cjs/index.js +31 -37
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +30 -37
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +11 -7
package/dist/cjs/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var bundlerPluginCore = require('@sentry/bundler-plugin-core');
|
|
6
6
|
var path = require('path');
|
|
7
7
|
var uuid = require('uuid');
|
|
8
|
-
var
|
|
8
|
+
var webback4or5 = require('webpack');
|
|
9
9
|
|
|
10
10
|
function _interopNamespace(e) {
|
|
11
11
|
if (e && e.__esModule) return e;
|
|
@@ -26,27 +26,25 @@ function _interopNamespace(e) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
29
|
+
var webback4or5__namespace = /*#__PURE__*/_interopNamespace(webback4or5);
|
|
29
30
|
|
|
30
31
|
function webpackReleaseInjectionPlugin(injectionCode) {
|
|
31
32
|
return {
|
|
32
33
|
name: "sentry-webpack-release-injection-plugin",
|
|
33
34
|
webpack: function webpack(compiler) {
|
|
34
35
|
var _compiler$webpack;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
banner: injectionCode
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
37
|
+
// @ts-ignore webpack version compatibility shenanigans
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
39
|
+
var BannerPlugin = (compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack = compiler.webpack) === null || _compiler$webpack === void 0 ? void 0 : _compiler$webpack.BannerPlugin) || (webback4or5__namespace === null || webback4or5__namespace === void 0 ? void 0 : webback4or5__namespace.BannerPlugin);
|
|
40
|
+
compiler.options.plugins = compiler.options.plugins || [];
|
|
41
|
+
compiler.options.plugins.push(
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
|
|
43
|
+
new BannerPlugin({
|
|
44
|
+
raw: true,
|
|
45
|
+
include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
|
|
46
|
+
banner: injectionCode
|
|
47
|
+
}));
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
50
|
}
|
|
@@ -55,25 +53,20 @@ function webpackDebugIdInjectionPlugin() {
|
|
|
55
53
|
name: "sentry-webpack-debug-id-injection-plugin",
|
|
56
54
|
webpack: function webpack(compiler) {
|
|
57
55
|
var _compiler$webpack2;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
banner: function banner() {
|
|
73
|
-
return bundlerPluginCore.getDebugIdSnippet(uuid.v4());
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
57
|
+
// @ts-ignore webpack version compatibility shenanigans
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
59
|
+
var BannerPlugin = (compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack2 = compiler.webpack) === null || _compiler$webpack2 === void 0 ? void 0 : _compiler$webpack2.BannerPlugin) || (webback4or5__namespace === null || webback4or5__namespace === void 0 ? void 0 : webback4or5__namespace.BannerPlugin);
|
|
60
|
+
compiler.options.plugins = compiler.options.plugins || [];
|
|
61
|
+
compiler.options.plugins.push(
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
|
|
63
|
+
new BannerPlugin({
|
|
64
|
+
raw: true,
|
|
65
|
+
include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
|
|
66
|
+
banner: function banner() {
|
|
67
|
+
return bundlerPluginCore.getDebugIdSnippet(uuid.v4());
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
77
70
|
}
|
|
78
71
|
};
|
|
79
72
|
}
|
|
@@ -83,8 +76,9 @@ function webpackDebugIdUploadPlugin(upload) {
|
|
|
83
76
|
name: pluginName,
|
|
84
77
|
webpack: function webpack(compiler) {
|
|
85
78
|
compiler.hooks.afterEmit.tapAsync(pluginName, function (compilation, callback) {
|
|
86
|
-
var
|
|
87
|
-
|
|
79
|
+
var _ref;
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
81
|
+
var outputPath = (_ref = compilation.outputOptions.path) !== null && _ref !== void 0 ? _ref : path__namespace.resolve();
|
|
88
82
|
var buildArtifacts = Object.keys(compilation.assets).map(function (asset) {
|
|
89
83
|
return path__namespace.join(outputPath, asset);
|
|
90
84
|
});
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { getDebugIdSnippet, Options, sentryUnpluginFactory } from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { getDebugIdSnippet, Options, sentryUnpluginFactory } from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore webpack is a peer dep\nimport * as webback4or5 from \"webpack\";\n\nfunction webpackReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-webpack-release-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: injectionCode,\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-webpack-debug-id-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: () => getDebugIdSnippet(uuidv4()),\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return {\n name: pluginName,\n webpack(compiler) {\n compiler.hooks.afterEmit.tapAsync(pluginName, (compilation, callback: () => void) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const outputPath = (compilation.outputOptions.path as string | undefined) ?? path.resolve();\n const buildArtifacts = Object.keys(compilation.assets as Record<string, unknown>).map(\n (asset) => path.join(outputPath, asset)\n );\n void upload(buildArtifacts).then(() => {\n callback();\n });\n });\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin,\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin,\n debugIdUploadPlugin: webpackDebugIdUploadPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options: Options) => any = sentryUnplugin.webpack;\n\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\nexport type { Options as SentryWebpackPluginOptions } from \"@sentry/bundler-plugin-core\";\n"],"names":["webpackReleaseInjectionPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","webback4or5","options","plugins","push","raw","include","banner","webpackDebugIdInjectionPlugin","_compiler$webpack2","getDebugIdSnippet","uuidv4","webpackDebugIdUploadPlugin","upload","pluginName","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","sentryWebpackPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,6BAA6BA,CAACC,aAAqB,EAAmB;EAC7E,OAAO;AACLC,IAAAA,IAAI,EAAE,yCAAyC;IAC/CC,OAAO,EAAA,SAAAA,OAACC,CAAAA,QAAQ,EAAE;AAAA,MAAA,IAAAC,iBAAA,CAAA;AAChB;AACA;AACA;MACA,IAAMC,YAAY,GAAG,CAAAF,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAAC,KAAA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AACH,CAAA;AAEA,IAAMc,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEzC,6BAA6B;AACrD0C,EAAAA,sBAAsB,EAAE5B,6BAA6B;AACrD6B,EAAAA,mBAAmB,EAAEzB,0BAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACa0B,IAAAA,mBAA8C,GAAGL,cAAc,CAACpC;;;;;;;;"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,28 +2,25 @@ import { sentryUnpluginFactory, getDebugIdSnippet } from '@sentry/bundler-plugin
|
|
|
2
2
|
export { sentryCliBinaryExists } from '@sentry/bundler-plugin-core';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
|
-
import
|
|
5
|
+
import * as webback4or5 from 'webpack';
|
|
6
6
|
|
|
7
7
|
function webpackReleaseInjectionPlugin(injectionCode) {
|
|
8
8
|
return {
|
|
9
9
|
name: "sentry-webpack-release-injection-plugin",
|
|
10
10
|
webpack: function webpack(compiler) {
|
|
11
11
|
var _compiler$webpack;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
banner: injectionCode
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
|
+
// @ts-ignore webpack version compatibility shenanigans
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
15
|
+
var BannerPlugin = (compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack = compiler.webpack) === null || _compiler$webpack === void 0 ? void 0 : _compiler$webpack.BannerPlugin) || (webback4or5 === null || webback4or5 === void 0 ? void 0 : webback4or5.BannerPlugin);
|
|
16
|
+
compiler.options.plugins = compiler.options.plugins || [];
|
|
17
|
+
compiler.options.plugins.push(
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
|
|
19
|
+
new BannerPlugin({
|
|
20
|
+
raw: true,
|
|
21
|
+
include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
|
|
22
|
+
banner: injectionCode
|
|
23
|
+
}));
|
|
27
24
|
}
|
|
28
25
|
};
|
|
29
26
|
}
|
|
@@ -32,25 +29,20 @@ function webpackDebugIdInjectionPlugin() {
|
|
|
32
29
|
name: "sentry-webpack-debug-id-injection-plugin",
|
|
33
30
|
webpack: function webpack(compiler) {
|
|
34
31
|
var _compiler$webpack2;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
banner: function banner() {
|
|
50
|
-
return getDebugIdSnippet(v4());
|
|
51
|
-
}
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
33
|
+
// @ts-ignore webpack version compatibility shenanigans
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
35
|
+
var BannerPlugin = (compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack2 = compiler.webpack) === null || _compiler$webpack2 === void 0 ? void 0 : _compiler$webpack2.BannerPlugin) || (webback4or5 === null || webback4or5 === void 0 ? void 0 : webback4or5.BannerPlugin);
|
|
36
|
+
compiler.options.plugins = compiler.options.plugins || [];
|
|
37
|
+
compiler.options.plugins.push(
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
|
|
39
|
+
new BannerPlugin({
|
|
40
|
+
raw: true,
|
|
41
|
+
include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
|
|
42
|
+
banner: function banner() {
|
|
43
|
+
return getDebugIdSnippet(v4());
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
54
46
|
}
|
|
55
47
|
};
|
|
56
48
|
}
|
|
@@ -60,8 +52,9 @@ function webpackDebugIdUploadPlugin(upload) {
|
|
|
60
52
|
name: pluginName,
|
|
61
53
|
webpack: function webpack(compiler) {
|
|
62
54
|
compiler.hooks.afterEmit.tapAsync(pluginName, function (compilation, callback) {
|
|
63
|
-
var
|
|
64
|
-
|
|
55
|
+
var _ref;
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
57
|
+
var outputPath = (_ref = compilation.outputOptions.path) !== null && _ref !== void 0 ? _ref : path.resolve();
|
|
65
58
|
var buildArtifacts = Object.keys(compilation.assets).map(function (asset) {
|
|
66
59
|
return path.join(outputPath, asset);
|
|
67
60
|
});
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { getDebugIdSnippet, Options, sentryUnpluginFactory } from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { getDebugIdSnippet, Options, sentryUnpluginFactory } from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore webpack is a peer dep\nimport * as webback4or5 from \"webpack\";\n\nfunction webpackReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-webpack-release-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: injectionCode,\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-webpack-debug-id-injection-plugin\",\n webpack(compiler) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore webpack version compatibility shenanigans\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const BannerPlugin = compiler?.webpack?.BannerPlugin || webback4or5?.BannerPlugin;\n compiler.options.plugins = compiler.options.plugins || [];\n compiler.options.plugins.push(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call\n new BannerPlugin({\n raw: true,\n include: /\\.(js|ts|jsx|tsx|mjs|cjs)$/,\n banner: () => getDebugIdSnippet(uuidv4()),\n })\n );\n },\n };\n}\n\nfunction webpackDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return {\n name: pluginName,\n webpack(compiler) {\n compiler.hooks.afterEmit.tapAsync(pluginName, (compilation, callback: () => void) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const outputPath = (compilation.outputOptions.path as string | undefined) ?? path.resolve();\n const buildArtifacts = Object.keys(compilation.assets as Record<string, unknown>).map(\n (asset) => path.join(outputPath, asset)\n );\n void upload(buildArtifacts).then(() => {\n callback();\n });\n });\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin,\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin,\n debugIdUploadPlugin: webpackDebugIdUploadPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options: Options) => any = sentryUnplugin.webpack;\n\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\nexport type { Options as SentryWebpackPluginOptions } from \"@sentry/bundler-plugin-core\";\n"],"names":["webpackReleaseInjectionPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","webback4or5","options","plugins","push","raw","include","banner","webpackDebugIdInjectionPlugin","_compiler$webpack2","getDebugIdSnippet","uuidv4","webpackDebugIdUploadPlugin","upload","pluginName","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","sentryWebpackPlugin"],"mappings":";;;;;;AASA,SAASA,6BAA6BA,CAACC,aAAqB,EAAmB;EAC7E,OAAO;AACLC,IAAAA,IAAI,EAAE,yCAAyC;IAC/CC,OAAO,EAAA,SAAAA,OAACC,CAAAA,QAAQ,EAAE;AAAA,MAAA,IAAAC,iBAAA,CAAA;AAChB;AACA;AACA;MACA,IAAMC,YAAY,GAAG,CAAAF,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAAC,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,CAAAA,iBAAA,GAARD,QAAQ,CAAED,OAAO,cAAAE,iBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAjBA,iBAAA,CAAmBC,YAAY,MAAIC,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAXA,WAAW,CAAED,YAAY,CAAA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ED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/webpack-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Official Sentry Webpack plugin",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/webpack-plugin",
|
|
@@ -48,10 +48,9 @@
|
|
|
48
48
|
"prepack": "ts-node ./src/prepack.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sentry/bundler-plugin-core": "2.
|
|
51
|
+
"@sentry/bundler-plugin-core": "2.2.0",
|
|
52
52
|
"unplugin": "1.0.1",
|
|
53
|
-
"uuid": "^9.0.0"
|
|
54
|
-
"webpack-4": "npm:webpack@^4"
|
|
53
|
+
"uuid": "^9.0.0"
|
|
55
54
|
},
|
|
56
55
|
"devDependencies": {
|
|
57
56
|
"@babel/core": "7.18.5",
|
|
@@ -59,19 +58,24 @@
|
|
|
59
58
|
"@babel/preset-typescript": "7.17.12",
|
|
60
59
|
"@rollup/plugin-babel": "5.3.1",
|
|
61
60
|
"@rollup/plugin-commonjs": "22.0.1",
|
|
62
|
-
"@sentry-internal/eslint-config": "2.
|
|
63
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.
|
|
61
|
+
"@sentry-internal/eslint-config": "2.2.0",
|
|
62
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.2.0",
|
|
64
63
|
"@swc/core": "^1.2.205",
|
|
65
64
|
"@swc/jest": "^0.2.21",
|
|
66
65
|
"@types/jest": "^28.1.3",
|
|
67
66
|
"@types/node": "^18.6.3",
|
|
68
67
|
"@types/uuid": "^9.0.1",
|
|
68
|
+
"@types/webpack": "npm:@types/webpack@^4",
|
|
69
69
|
"eslint": "^8.18.0",
|
|
70
70
|
"jest": "^28.1.1",
|
|
71
71
|
"rimraf": "^3.0.2",
|
|
72
72
|
"rollup": "2.75.7",
|
|
73
73
|
"ts-node": "^10.9.1",
|
|
74
|
-
"typescript": "^4.7.4"
|
|
74
|
+
"typescript": "^4.7.4",
|
|
75
|
+
"webpack": "npm:webpack@^4"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"webpack": ">=4"
|
|
75
79
|
},
|
|
76
80
|
"volta": {
|
|
77
81
|
"extends": "../../package.json"
|