@sentry/webpack-plugin 2.3.0 → 2.5.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/README.md CHANGED
@@ -57,34 +57,34 @@ module.exports = {
57
57
 
58
58
  ## Options
59
59
 
60
- - [`org`](#optionorg)
61
- - [`project`](#optionproject)
62
- - [`authToken`](#optionauthtoken)
63
- - [`url`](#optionurl)
64
- - [`headers`](#optionheaders)
65
- - [`debug`](#optiondebug)
66
- - [`silent`](#optionsilent)
67
- - [`errorHandler`](#optionerrorhandler)
68
- - [`telemetry`](#optiontelemetry)
69
- - [`disable`](#optiondisable)
70
- - [`sourcemaps`](#optionsourcemaps)
71
- - [`assets`](#optionsourcemapsassets)
72
- - [`ignore`](#optionsourcemapsignore)
73
- - [`rewriteSources`](#optionsourcemapsrewritesources)
74
- - [`filesToDeleteAfterUpload`](#optionsourcemapsfilestodeleteafterupload)
75
- - [`release`](#optionrelease)
76
- - [`name`](#optionreleasename)
77
- - [`inject`](#optionreleaseinject)
78
- - [`create`](#optionreleasecreate)
79
- - [`finalize`](#optionreleasefinalize)
80
- - [`dist`](#optionreleasedist)
81
- - [`vcsRemote`](#optionreleasevcsremote)
82
- - [`setCommits`](#optionreleasesetcommits)
83
- - [`deploy`](#optionreleasedeploy)
84
- - [`cleanArtifacts`](#optionreleasecleanartifacts)
85
- - [`uploadLegacySourcemaps`](#optionreleaseuploadlegacysourcemaps)
86
- - [`_experiments`](#option_experiments)
87
- - [`injectBuildInformation`](#option_experimentsinjectbuildinformation)
60
+ - [`org`](#org)
61
+ - [`project`](#project)
62
+ - [`authToken`](#authtoken)
63
+ - [`url`](#url)
64
+ - [`headers`](#headers)
65
+ - [`debug`](#debug)
66
+ - [`silent`](#silent)
67
+ - [`errorHandler`](#errorhandler)
68
+ - [`telemetry`](#telemetry)
69
+ - [`disable`](#disable)
70
+ - [`sourcemaps`](#sourcemaps)
71
+ - [`assets`](#sourcemapsassets)
72
+ - [`ignore`](#sourcemapsignore)
73
+ - [`rewriteSources`](#sourcemapsrewritesources)
74
+ - [`filesToDeleteAfterUpload`](#sourcemapsfilestodeleteafterupload)
75
+ - [`release`](#release)
76
+ - [`name`](#releasename)
77
+ - [`inject`](#releaseinject)
78
+ - [`create`](#releasecreate)
79
+ - [`finalize`](#releasefinalize)
80
+ - [`dist`](#releasedist)
81
+ - [`vcsRemote`](#releasevcsremote)
82
+ - [`setCommits`](#releasesetcommits)
83
+ - [`deploy`](#releasedeploy)
84
+ - [`cleanArtifacts`](#releasecleanartifacts)
85
+ - [`uploadLegacySourcemaps`](#releaseuploadlegacysourcemaps)
86
+ - [`_experiments`](#_experiments)
87
+ - [`injectBuildInformation`](#_experimentsinjectbuildinformation)
88
88
 
89
89
  ### `org`
90
90
 
@@ -140,7 +140,7 @@ Suppresses all logs. Defaults to `false`.
140
140
 
141
141
  Type: `(err: Error) => void`
142
142
 
143
- When an error occurs during rlease creation or sourcemaps upload, the plugin will call this function.
143
+ When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
144
144
 
145
145
  By default, the plugin will simply throw an error, thereby stopping the bundling process. If an `errorHandler` callback is provided, compilation will continue, unless an error is thrown in the provided callback.
146
146
 
@@ -173,7 +173,7 @@ Completely disables all functionality of the plugin. Defaults to `false`.
173
173
 
174
174
 
175
175
 
176
- Options for source maps uploading. Leave this option undefined if you do not want to upload source maps to Sentry.
176
+ Options for uploading source maps.
177
177
  ### `sourcemaps.assets`
178
178
 
179
179
  Type: `string | string[]`
@@ -494,6 +494,10 @@ Defaults to `false`.
494
494
 
495
495
 
496
496
 
497
+ ### Configuration File
498
+
499
+ As an additional configuration method, the Sentry Webpack plugin will pick up environment variables configured inside a `.env.sentry-build-plugin` file located in the current working directory when building your app.
500
+
497
501
  ## More information
498
502
 
499
503
  - [Sentry Documentation](https://docs.sentry.io/quickstart/)
package/dist/cjs/index.js CHANGED
@@ -91,8 +91,29 @@ function webpackDebugIdUploadPlugin(upload) {
91
91
  }
92
92
  };
93
93
  }
94
+ function webpackModuleMetadataInjectionPlugin(injectionCode) {
95
+ return {
96
+ name: "sentry-webpack-module-metadata-injection-plugin",
97
+ webpack: function webpack(compiler) {
98
+ var _compiler$webpack3;
99
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
100
+ // @ts-ignore webpack version compatibility shenanigans
101
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
102
+ var BannerPlugin = (compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack3 = compiler.webpack) === null || _compiler$webpack3 === void 0 ? void 0 : _compiler$webpack3.BannerPlugin) || (webback4or5__namespace === null || webback4or5__namespace === void 0 ? void 0 : webback4or5__namespace.BannerPlugin);
103
+ compiler.options.plugins = compiler.options.plugins || [];
104
+ compiler.options.plugins.push(
105
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
106
+ new BannerPlugin({
107
+ raw: true,
108
+ include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
109
+ banner: injectionCode
110
+ }));
111
+ }
112
+ };
113
+ }
94
114
  var sentryUnplugin = bundlerPluginCore.sentryUnpluginFactory({
95
115
  releaseInjectionPlugin: webpackReleaseInjectionPlugin,
116
+ moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin,
96
117
  debugIdInjectionPlugin: webpackDebugIdInjectionPlugin,
97
118
  debugIdUploadPlugin: webpackDebugIdUploadPlugin
98
119
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n} 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\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n };\n}\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: (arg?: BannerPluginCallbackArg) => {\n const debugId = arg?.chunk?.hash ? stringToUUID(arg.chunk.hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\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","arg","_arg$chunk","debugId","chunk","hash","stringToUUID","uuidv4","getDebugIdSnippet","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,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,KAA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,CAACU,MAAiC,CAAC,CAACC,GAAG,CACnF,UAACC,KAAK,EAAA;AAAA,UAAA,OAAKP,eAAI,CAACQ,IAAI,CAACV,UAAU,EAAES,KAAK,CAAC,CAAA;AAAA,SACzC,CAAC,CAAA;AACD,QAAA,KAAKjB,MAAM,CAACY,cAAc,CAAC,CAACO,IAAI,CAAC,YAAM;AACrCb,UAAAA,QAAQ,EAAE,CAAA;AACZ,SAAC,CAAC,CAAA;AACJ,OAAC,CAAC,CAAA;AACJ,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMc,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAE/C,6BAA6B;AACrDgD,EAAAA,sBAAsB,EAAElC,6BAA6B;AACrDmC,EAAAA,mBAAmB,EAAEzB,0BAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACa0B,IAAAA,mBAA8C,GAAGL,cAAc,CAAC1C;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n} 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\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n };\n}\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: (arg?: BannerPluginCallbackArg) => {\n const debugId = arg?.chunk?.hash ? stringToUUID(arg.chunk.hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\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\nfunction webpackModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-webpack-module-metadata-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\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin,\n moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin,\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","arg","_arg$chunk","debugId","chunk","hash","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","upload","pluginName","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","webpackModuleMetadataInjectionPlugin","_compiler$webpack3","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","moduleMetadataInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","sentryWebpackPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAASA,6BAA6BA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AA,QAAQ,CAACI,OAAO,CAACC,OAAO,CAACC,IAAI;AAC3B;AACA,MAAA,IAAIJ,YAAY,CAAC;AACfK,QAAAA,GAAG,EAAE,IAAI;AACTC,QAAAA,OAAO,EAAE,4BAA4B;AACrCC,QAAAA,MAAM,EAAEZ,aAAAA;AACV,OAAC,CACH,CAAC,CAAA;AACH,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAM8C,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEjD,6BAA6B;AACrDkD,EAAAA,6BAA6B,EAAEL,oCAAoC;AACnEM,EAAAA,sBAAsB,EAAErC,6BAA6B;AACrDsC,EAAAA,mBAAmB,EAAE5B,0BAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACa6B,IAAAA,mBAA8C,GAAGN,cAAc,CAAC5C;;;;;;;;"}
@@ -67,8 +67,29 @@ function webpackDebugIdUploadPlugin(upload) {
67
67
  }
68
68
  };
69
69
  }
70
+ function webpackModuleMetadataInjectionPlugin(injectionCode) {
71
+ return {
72
+ name: "sentry-webpack-module-metadata-injection-plugin",
73
+ webpack: function webpack(compiler) {
74
+ var _compiler$webpack3;
75
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
76
+ // @ts-ignore webpack version compatibility shenanigans
77
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
78
+ var BannerPlugin = (compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack3 = compiler.webpack) === null || _compiler$webpack3 === void 0 ? void 0 : _compiler$webpack3.BannerPlugin) || (webback4or5 === null || webback4or5 === void 0 ? void 0 : webback4or5.BannerPlugin);
79
+ compiler.options.plugins = compiler.options.plugins || [];
80
+ compiler.options.plugins.push(
81
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
82
+ new BannerPlugin({
83
+ raw: true,
84
+ include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
85
+ banner: injectionCode
86
+ }));
87
+ }
88
+ };
89
+ }
70
90
  var sentryUnplugin = sentryUnpluginFactory({
71
91
  releaseInjectionPlugin: webpackReleaseInjectionPlugin,
92
+ moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin,
72
93
  debugIdInjectionPlugin: webpackDebugIdInjectionPlugin,
73
94
  debugIdUploadPlugin: webpackDebugIdUploadPlugin
74
95
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n} 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\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n };\n}\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: (arg?: BannerPluginCallbackArg) => {\n const debugId = arg?.chunk?.hash ? stringToUUID(arg.chunk.hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\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","arg","_arg$chunk","debugId","chunk","hash","stringToUUID","uuidv4","getDebugIdSnippet","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":";;;;;;AAoBA,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,CAAA;MACjFF,QAAQ,CAACI,OAAO,CAACC,OAAO,GAAGL,QAAQ,CAACI,OAAO,CAACC,OAAO,IAAI,EAAE,CAAA;AACzDL,MAAAA,QAAQ,CAACI,OAAO,CAACC,OAAO,CAACC,IAAI;AAC3B;AACA,MAAA,IAAIJ,YAAY,CAAC;AACfK,QAAAA,GAAG,EAAE,IAAI;AACTC,QAAAA,OAAO,EAAE,4BAA4B;AACrCC,QAAAA,MAAM,EAAEZ,aAAAA;AACV,OAAC,CACH,CAAC,CAAA;AACH,KAAA;GACD,CAAA;AACH,CAAA;AAEA,SAASa,6BAA6BA,GAAoB;EACxD,OAAO;AACLZ,IAAAA,I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,CACjCC,MAAmD,EAClC;EACjB,IAAMC,UAAU,GAAG,uCAAuC,CAAA;EAC1D,OAAO;AACLxB,IAAAA,IAAI,EAAEwB,UAAU;IAChBvB,OAAO,EAAA,SAAAA,OAACC,CAAAA,QAAQ,EAAE;AAChBA,MAAAA,QAAQ,CAACuB,KAAK,CAACC,SAAS,CAACC,QAAQ,CAACH,UAAU,EAAE,UAACI,WAAW,EAAEC,QAAoB,EAAK;AAAA,QAAA,IAAAC,IAAA,CAAA;AACnF;AACA,QAAA,IAAMC,UAAU,GAAAD,CAAAA,IAAA,GAAIF,WAAW,CAACI,aAAa,CAACC,IAAI,MAAAH,IAAAA,IAAAA,IAAA,cAAAA,IAAA,GAA2BG,IAAI,CAACC,OAAO,EAAE,CAAA;AAC3F,QAAA,IAAMC,cAAc,GAAGC,MAAM,CAACC,IAAI,CAACT,WAAW,CAACU,MAAiC,CAAC,CAACC,GAAG,CACnF,UAACC,KAAK,EAAA;AAAA,UAAA,OAAKP,IAAI,CAACQ,IAAI,CAACV,UAAU,EAAES,KAAK,CAAC,CAAA;AAAA,SACzC,CAAC,CAAA;AACD,QAAA,KAAKjB,MAAM,CAACY,cAAc,CAAC,CAACO,IAAI,CAAC,YAAM;AACrCb,UAAAA,QAAQ,EAAE,CAAA;AACZ,SAAC,CAAC,CAAA;AACJ,OAAC,CAAC,CAAA;AACJ,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMc,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAE/C,6BAA6B;AACrDgD,EAAAA,sBAAsB,EAAElC,6BAA6B;AACrDmC,EAAAA,mBAAmB,EAAEzB,0BAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACa0B,IAAAA,mBAA8C,GAAGL,cAAc,CAAC1C;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n} 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\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n };\n}\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: (arg?: BannerPluginCallbackArg) => {\n const debugId = arg?.chunk?.hash ? stringToUUID(arg.chunk.hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\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\nfunction webpackModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-webpack-module-metadata-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\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin,\n moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin,\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","arg","_arg$chunk","debugId","chunk","hash","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","upload","pluginName","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","webpackModuleMetadataInjectionPlugin","_compiler$webpack3","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","moduleMetadataInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","sentryWebpackPlugin"],"mappings":";;;;;;AAoBA,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,CAAA;MACjFF,QAAQ,CAACI,OAAO,CAACC,OAAO,GAAGL,QAAQ,CAACI,OAAO,CAACC,OAAO,IAAI,EAAE,CAAA;AACzDL,MAAAA,QAAQ,CAACI,OAAO,CAACC,OAAO,CAACC,IAAI;AAC3B;AACA,MAAA,IAAIJ,YAAY,CAAC;AACfK,QAAAA,GAAG,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0C,kBAAA,CAAA;AAChB;AACA;AACA;MACA,IAAMxC,YAAY,GAAG,CAAAF,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAA0C,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,CAAAA,kBAAA,GAAR1C,QAAQ,CAAED,OAAO,cAAA2C,kBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAjBA,kBAAA,CAAmBxC,YAAY,MAAIC,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAXA,WAAW,CAAED,YAAY,CAAA,CAAA;MACjFF,QAAQ,CAACI,OAAO,CAACC,OAAO,GAAGL,QAAQ,CAACI,OAAO,CAACC,OAAO,IAAI,EAAE,CAAA;AACzDL,MAAAA,QAAQ,CAACI,OAAO,CAACC,OAAO,CAACC,IAAI;AAC3B;AACA,MAAA,IAAIJ,YAAY,CAAC;AACfK,QAAAA,GAAG,EAAE,IAAI;AACTC,QAAAA,OAAO,EAAE,4BAA4B;AACrCC,QAAAA,MAAM,EAAEZ,aAAAA;AACV,OAAC,CACH,CAAC,CAAA;AACH,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAM8C,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEjD,6BAA6B;AACrDkD,EAAAA,6BAA6B,EAAEL,oCAAoC;AACnEM,EAAAA,sBAAsB,EAAErC,6BAA6B;AACrDsC,EAAAA,mBAAmB,EAAE5B,0BAAAA;AACvB,CAAC,CAAC,CAAA;;AAEF;AACa6B,IAAAA,mBAA8C,GAAGN,cAAc,CAAC5C;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/webpack-plugin",
3
- "version": "2.3.0",
3
+ "version": "2.5.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,7 +48,7 @@
48
48
  "prepack": "ts-node ./src/prepack.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@sentry/bundler-plugin-core": "2.3.0",
51
+ "@sentry/bundler-plugin-core": "2.5.0",
52
52
  "unplugin": "1.0.1",
53
53
  "uuid": "^9.0.0"
54
54
  },
@@ -58,8 +58,8 @@
58
58
  "@babel/preset-typescript": "7.17.12",
59
59
  "@rollup/plugin-babel": "5.3.1",
60
60
  "@rollup/plugin-commonjs": "22.0.1",
61
- "@sentry-internal/eslint-config": "2.3.0",
62
- "@sentry-internal/sentry-bundler-plugin-tsconfig": "2.3.0",
61
+ "@sentry-internal/eslint-config": "2.5.0",
62
+ "@sentry-internal/sentry-bundler-plugin-tsconfig": "2.5.0",
63
63
  "@swc/core": "^1.2.205",
64
64
  "@swc/jest": "^0.2.21",
65
65
  "@types/jest": "^28.1.3",
@@ -81,6 +81,6 @@
81
81
  "extends": "../../package.json"
82
82
  },
83
83
  "engines": {
84
- "node": ">= 10"
84
+ "node": ">= 14"
85
85
  }
86
86
  }