@sentry/webpack-plugin 3.3.1 → 3.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 +24 -0
- package/dist/cjs/webpack4and5.js +25 -24
- package/dist/cjs/webpack4and5.js.map +1 -1
- package/dist/esm/webpack4and5.mjs +25 -24
- package/dist/esm/webpack4and5.mjs.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -72,6 +72,7 @@ module.exports = {
|
|
|
72
72
|
- [`assets`](#sourcemapsassets)
|
|
73
73
|
- [`ignore`](#sourcemapsignore)
|
|
74
74
|
- [`rewriteSources`](#sourcemapsrewritesources)
|
|
75
|
+
- [`resolveSourceMap`](#sourcemapsresolvesourcemap)
|
|
75
76
|
- [`filesToDeleteAfterUpload`](#sourcemapsfilestodeleteafterupload)
|
|
76
77
|
- [`disable`](#sourcemapsdisable)
|
|
77
78
|
- [`release`](#release)
|
|
@@ -221,6 +222,29 @@ Hook to rewrite the `sources` field inside the source map before being uploaded
|
|
|
221
222
|
|
|
222
223
|
Defaults to making all sources relative to `process.cwd()` while building.
|
|
223
224
|
|
|
225
|
+
### `sourcemaps.resolveSourceMap`
|
|
226
|
+
|
|
227
|
+
Type: `(artifactPath: string, sourceMappingUrl: string | undefined) => string | undefined | Promise<string | undefined>`
|
|
228
|
+
|
|
229
|
+
Hook to customize source map file resolution.
|
|
230
|
+
|
|
231
|
+
The hook is called with the absolute path of the build artifact and the value of the `//# sourceMappingURL=`
|
|
232
|
+
comment, if present. The hook should then return an absolute path (or a promise that resolves to one) indicating
|
|
233
|
+
where to find the artifact's corresponding source map file. If no path is returned or the returned path doesn't
|
|
234
|
+
exist, the standard source map resolution process will be used.
|
|
235
|
+
|
|
236
|
+
The standard process first tries to resolve based on the `//# sourceMappingURL=` value (it supports `file://`
|
|
237
|
+
urls and absolute/relative paths). If that path doesn't exist, it then looks for a file named
|
|
238
|
+
`${artifactName}.map` in the same directory as the artifact.
|
|
239
|
+
|
|
240
|
+
Note: This is mostly helpful for complex builds with custom source map generation. For example, if you put source
|
|
241
|
+
maps into a separate directory and rewrite the `//# sourceMappingURL=` comment to something other than a relative
|
|
242
|
+
directory, sentry will be unable to locate the source maps for a given build artifact. This hook allows you to
|
|
243
|
+
implement the resolution process yourself.
|
|
244
|
+
|
|
245
|
+
Use the `debug` option to print information about source map resolution.
|
|
246
|
+
|
|
247
|
+
|
|
224
248
|
### `sourcemaps.filesToDeleteAfterUpload`
|
|
225
249
|
|
|
226
250
|
Type: `string | string[] | Promise<string | string[]>`
|
package/dist/cjs/webpack4and5.js
CHANGED
|
@@ -168,33 +168,34 @@ function webpackDebugIdInjectionPlugin(UnsafeBannerPlugin) {
|
|
|
168
168
|
};
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function webpackDebugIdUploadPlugin() {
|
|
171
|
+
function webpackDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts, forceExitOnBuildCompletion) {
|
|
172
172
|
var pluginName = "sentry-webpack-debug-id-upload-plugin";
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
173
|
+
return {
|
|
174
|
+
name: pluginName,
|
|
175
|
+
webpack: function webpack(compiler) {
|
|
176
|
+
var freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();
|
|
177
|
+
compiler.hooks.afterEmit.tapAsync(pluginName, function (compilation, callback) {
|
|
178
|
+
var _ref;
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
180
|
+
var outputPath = (_ref = compilation.outputOptions.path) !== null && _ref !== void 0 ? _ref : path__namespace.resolve();
|
|
181
|
+
var buildArtifacts = Object.keys(compilation.assets).map(function (asset) {
|
|
182
|
+
return path__namespace.join(outputPath, asset);
|
|
183
|
+
});
|
|
184
|
+
void upload(buildArtifacts).then(function () {
|
|
185
|
+
callback();
|
|
186
|
+
})["finally"](function () {
|
|
187
|
+
freeGlobalDependencyOnDebugIdSourcemapArtifacts();
|
|
187
188
|
});
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
});
|
|
190
|
+
if (forceExitOnBuildCompletion && compiler.options.mode === "production") {
|
|
191
|
+
compiler.hooks.done.tap(pluginName, function () {
|
|
192
|
+
setTimeout(function () {
|
|
193
|
+
logger.debug("Exiting process after debug file upload");
|
|
194
|
+
process.exit(0);
|
|
194
195
|
});
|
|
195
|
-
}
|
|
196
|
+
});
|
|
196
197
|
}
|
|
197
|
-
}
|
|
198
|
+
}
|
|
198
199
|
};
|
|
199
200
|
}
|
|
200
201
|
function webpackModuleMetadataInjectionPlugin(UnsafeBannerPlugin) {
|
|
@@ -241,7 +242,7 @@ function sentryWebpackUnpluginFactory() {
|
|
|
241
242
|
componentNameAnnotatePlugin: webpackComponentNameAnnotatePlugin(),
|
|
242
243
|
moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin(BannerPlugin),
|
|
243
244
|
debugIdInjectionPlugin: webpackDebugIdInjectionPlugin(BannerPlugin),
|
|
244
|
-
debugIdUploadPlugin: webpackDebugIdUploadPlugin
|
|
245
|
+
debugIdUploadPlugin: webpackDebugIdUploadPlugin,
|
|
245
246
|
bundleSizeOptimizationsPlugin: webpackBundleSizeOptimizationsPlugin(DefinePlugin)
|
|
246
247
|
});
|
|
247
248
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack4and5.js","sources":["../../src/webpack4and5.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n SentrySDKBuildFlags,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version\n// https://github.com/webpack/webpack/commit/65eca2e529ce1d79b79200d4bdb1ce1b81141459\n\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n contentHash?: {\n javascript?: string;\n };\n };\n}\n\ntype UnsafeBannerPlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\ntype UnsafeDefinePlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\nfunction webpackReleaseInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string): UnpluginOptions => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 webpackComponentNameAnnotatePlugin(): (ignoredComponents?: string[]) => UnpluginOptions {\n return (ignoredComponents?: string[]) => ({\n name: \"sentry-webpack-component-name-annotate-plugin\",\n enforce: \"pre\",\n // Webpack needs this hook for loader logic, so the plugin is not run on unsupported file types\n transformInclude(id) {\n return id.endsWith(\".tsx\") || id.endsWith(\".jsx\");\n },\n transform: createComponentNameAnnotateHooks(ignoredComponents).transform,\n });\n}\n\nfunction webpackBundleSizeOptimizationsPlugin(\n UnsafeDefinePlugin: UnsafeDefinePlugin | undefined\n): (replacementValues: SentrySDKBuildFlags) => UnpluginOptions {\n return (replacementValues: SentrySDKBuildFlags) => ({\n name: \"sentry-webpack-bundle-size-optimizations-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 DefinePlugin =\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-member-access\n compiler?.webpack?.DefinePlugin || UnsafeDefinePlugin;\n\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 DefinePlugin({\n ...replacementValues,\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): () => 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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 hash = arg?.chunk?.contentHash?.javascript ?? arg?.chunk?.hash;\n const debugId = hash ? stringToUUID(hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdUploadPlugin(): (\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n forceExitOnBuildCompletion?: boolean\n) => UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return (\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n forceExitOnBuildCompletion?: boolean\n ) => ({\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 if (forceExitOnBuildCompletion && compiler.options.mode === \"production\") {\n compiler.hooks.done.tap(pluginName, () => {\n setTimeout(() => {\n logger.debug(\"Exiting process after debug file upload\");\n process.exit(0);\n });\n });\n }\n },\n });\n}\n\nfunction webpackModuleMetadataInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string) => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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\n/**\n * The factory function accepts BannerPlugin and DefinePlugin classes in\n * order to avoid direct dependencies on webpack.\n *\n * This allow us to export version of the plugin for webpack 5.1+ and compatible environments.\n *\n * Since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version.\n */\nexport function sentryWebpackUnpluginFactory({\n BannerPlugin,\n DefinePlugin,\n}: {\n BannerPlugin?: UnsafeBannerPlugin;\n DefinePlugin?: UnsafeDefinePlugin;\n} = {}): ReturnType<typeof sentryUnpluginFactory> {\n return sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin(BannerPlugin),\n componentNameAnnotatePlugin: webpackComponentNameAnnotatePlugin(),\n moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin(BannerPlugin),\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin(BannerPlugin),\n debugIdUploadPlugin: webpackDebugIdUploadPlugin(),\n bundleSizeOptimizationsPlugin: webpackBundleSizeOptimizationsPlugin(DefinePlugin),\n });\n}\n\nexport type SentryWebpackPluginOptions = Options & {\n _experiments?: Options[\"_experiments\"] & {\n /**\n * If enabled, the webpack plugin will exit the build process after the build completes.\n * Use this with caution, as it will terminate the process.\n *\n * More information: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/345\n *\n * @default false\n */\n forceExitOnBuildCompletion?: boolean;\n };\n};\n"],"names":["webpackReleaseInjectionPlugin","UnsafeBannerPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","options","plugins","push","raw","include","banner","webpackComponentNameAnnotatePlugin","ignoredComponents","enforce","transformInclude","id","endsWith","transform","createComponentNameAnnotateHooks","webpackBundleSizeOptimizationsPlugin","UnsafeDefinePlugin","replacementValues","_compiler$webpack2","DefinePlugin","_objectSpread","webpackDebugIdInjectionPlugin","_compiler$webpack3","arg","_arg$chunk$contentHas","_arg$chunk","_arg$chunk$contentHas2","_arg$chunk2","hash","chunk","contentHash","javascript","debugId","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","pluginName","upload","logger","forceExitOnBuildCompletion","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","mode","done","tap","setTimeout","debug","process","exit","webpackModuleMetadataInjectionPlugin","_compiler$webpack4","sentryWebpackUnpluginFactory","_ref2","arguments","length","undefined","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","moduleMetadataInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;AACA;AAqBA,SAASA,6BAA6BA,CACpCC,kBAAkD,EACN;AAC5C,EAAA,OAAO,UAACC,aAAqB,EAAA;IAAA,OAAuB;AAClDC,MAAAA,IAAI,EAAE,yCAAyC;MAC/CC,OAAO,EAAA,SAAAA,OAACC,CAAAA,QAAQ,EAAE;AAAA,QAAA,IAAAC,iBAAA,CAAA;AAChB;AACA;AACA;AACA,QAAA,IAAMC,YAAY;AAChB;AACA;AACA;AACA,QAAA,CAAAF,QAAQ,KAARA,IAAAA,IAAAA,QAAQ,KAAAC,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,CAAAA,iBAAA,GAARD,QAAQ,CAAED,OAAO,MAAA,IAAA,IAAAE,iBAAA,KAAjBA,KAAAA,CAAAA,GAAAA,KAAAA,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AAEhE,oCAAoC,CAACI,YAAY,CAAA;AAClF,GAAC,CAAC,CAAA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"webpack4and5.js","sources":["../../src/webpack4and5.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n SentrySDKBuildFlags,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version\n// https://github.com/webpack/webpack/commit/65eca2e529ce1d79b79200d4bdb1ce1b81141459\n\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n contentHash?: {\n javascript?: string;\n };\n };\n}\n\ntype UnsafeBannerPlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\ntype UnsafeDefinePlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\nfunction webpackReleaseInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string): UnpluginOptions => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 webpackComponentNameAnnotatePlugin(): (ignoredComponents?: string[]) => UnpluginOptions {\n return (ignoredComponents?: string[]) => ({\n name: \"sentry-webpack-component-name-annotate-plugin\",\n enforce: \"pre\",\n // Webpack needs this hook for loader logic, so the plugin is not run on unsupported file types\n transformInclude(id) {\n return id.endsWith(\".tsx\") || id.endsWith(\".jsx\");\n },\n transform: createComponentNameAnnotateHooks(ignoredComponents).transform,\n });\n}\n\nfunction webpackBundleSizeOptimizationsPlugin(\n UnsafeDefinePlugin: UnsafeDefinePlugin | undefined\n): (replacementValues: SentrySDKBuildFlags) => UnpluginOptions {\n return (replacementValues: SentrySDKBuildFlags) => ({\n name: \"sentry-webpack-bundle-size-optimizations-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 DefinePlugin =\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-member-access\n compiler?.webpack?.DefinePlugin || UnsafeDefinePlugin;\n\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 DefinePlugin({\n ...replacementValues,\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): () => 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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 hash = arg?.chunk?.contentHash?.javascript ?? arg?.chunk?.hash;\n const debugId = hash ? stringToUUID(hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void,\n forceExitOnBuildCompletion?: boolean\n): UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return {\n name: pluginName,\n webpack(compiler) {\n const freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();\n\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)\n .then(() => {\n callback();\n })\n .finally(() => {\n freeGlobalDependencyOnDebugIdSourcemapArtifacts();\n });\n });\n\n if (forceExitOnBuildCompletion && compiler.options.mode === \"production\") {\n compiler.hooks.done.tap(pluginName, () => {\n setTimeout(() => {\n logger.debug(\"Exiting process after debug file upload\");\n process.exit(0);\n });\n });\n }\n },\n };\n}\n\nfunction webpackModuleMetadataInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string) => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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\n/**\n * The factory function accepts BannerPlugin and DefinePlugin classes in\n * order to avoid direct dependencies on webpack.\n *\n * This allow us to export version of the plugin for webpack 5.1+ and compatible environments.\n *\n * Since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version.\n */\nexport function sentryWebpackUnpluginFactory({\n BannerPlugin,\n DefinePlugin,\n}: {\n BannerPlugin?: UnsafeBannerPlugin;\n DefinePlugin?: UnsafeDefinePlugin;\n} = {}): ReturnType<typeof sentryUnpluginFactory> {\n return sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin(BannerPlugin),\n componentNameAnnotatePlugin: webpackComponentNameAnnotatePlugin(),\n moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin(BannerPlugin),\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin(BannerPlugin),\n debugIdUploadPlugin: webpackDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: webpackBundleSizeOptimizationsPlugin(DefinePlugin),\n });\n}\n\nexport type SentryWebpackPluginOptions = Options & {\n _experiments?: Options[\"_experiments\"] & {\n /**\n * If enabled, the webpack plugin will exit the build process after the build completes.\n * Use this with caution, as it will terminate the process.\n *\n * More information: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/345\n *\n * @default false\n */\n forceExitOnBuildCompletion?: boolean;\n };\n};\n"],"names":["webpackReleaseInjectionPlugin","UnsafeBannerPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","options","plugins","push","raw","include","banner","webpackComponentNameAnnotatePlugin","ignoredComponents","enforce","transformInclude","id","endsWith","transform","createComponentNameAnnotateHooks","webpackBundleSizeOptimizationsPlugin","UnsafeDefinePlugin","replacementValues","_compiler$webpack2","DefinePlugin","_objectSpread","webpackDebugIdInjectionPlugin","_compiler$webpack3","arg","_arg$chunk$contentHas","_arg$chunk","_arg$chunk$contentHas2","_arg$chunk2","hash","chunk","contentHash","javascript","debugId","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","upload","logger","createDependencyOnBuildArtifacts","forceExitOnBuildCompletion","pluginName","freeGlobalDependencyOnDebugIdSourcemapArtifacts","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","mode","done","tap","setTimeout","debug","process","exit","webpackModuleMetadataInjectionPlugin","_compiler$webpack4","sentryWebpackUnpluginFactory","_ref2","arguments","length","undefined","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","moduleMetadataInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;AACA;AAqBA,SAASA,6BAA6BA,CACpCC,kBAAkD,EACN;AAC5C,EAAA,OAAO,UAACC,aAAqB,EAAA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AAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAA9C,EAAE;IALJxE,YAAY,GAAAuE,KAAA,CAAZvE,YAAY;IACZmB,YAAY,GAAAoD,KAAA,CAAZpD,YAAY,CAAA;AAKZ,EAAA,OAAOwD,uCAAqB,CAAC;AAC3BC,IAAAA,sBAAsB,EAAEnF,6BAA6B,CAACO,YAAY,CAAC;IACnE6E,2BAA2B,EAAEtE,kCAAkC,EAAE;AACjEuE,IAAAA,6BAA6B,EAAEV,oCAAoC,CAACpE,YAAY,CAAC;AACjF+E,IAAAA,sBAAsB,EAAE1D,6BAA6B,CAACrB,YAAY,CAAC;AACnEgF,IAAAA,mBAAmB,EAAE5C,0BAA0B;IAC/C6C,6BAA6B,EAAElE,oCAAoC,CAACI,YAAY,CAAA;AAClF,GAAC,CAAC,CAAA;AACJ;;;;"}
|
|
@@ -146,33 +146,34 @@ function webpackDebugIdInjectionPlugin(UnsafeBannerPlugin) {
|
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function webpackDebugIdUploadPlugin() {
|
|
149
|
+
function webpackDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts, forceExitOnBuildCompletion) {
|
|
150
150
|
var pluginName = "sentry-webpack-debug-id-upload-plugin";
|
|
151
|
-
return
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
151
|
+
return {
|
|
152
|
+
name: pluginName,
|
|
153
|
+
webpack: function webpack(compiler) {
|
|
154
|
+
var freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();
|
|
155
|
+
compiler.hooks.afterEmit.tapAsync(pluginName, function (compilation, callback) {
|
|
156
|
+
var _ref;
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
158
|
+
var outputPath = (_ref = compilation.outputOptions.path) !== null && _ref !== void 0 ? _ref : path.resolve();
|
|
159
|
+
var buildArtifacts = Object.keys(compilation.assets).map(function (asset) {
|
|
160
|
+
return path.join(outputPath, asset);
|
|
161
|
+
});
|
|
162
|
+
void upload(buildArtifacts).then(function () {
|
|
163
|
+
callback();
|
|
164
|
+
})["finally"](function () {
|
|
165
|
+
freeGlobalDependencyOnDebugIdSourcemapArtifacts();
|
|
165
166
|
});
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
});
|
|
168
|
+
if (forceExitOnBuildCompletion && compiler.options.mode === "production") {
|
|
169
|
+
compiler.hooks.done.tap(pluginName, function () {
|
|
170
|
+
setTimeout(function () {
|
|
171
|
+
logger.debug("Exiting process after debug file upload");
|
|
172
|
+
process.exit(0);
|
|
172
173
|
});
|
|
173
|
-
}
|
|
174
|
+
});
|
|
174
175
|
}
|
|
175
|
-
}
|
|
176
|
+
}
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
function webpackModuleMetadataInjectionPlugin(UnsafeBannerPlugin) {
|
|
@@ -219,7 +220,7 @@ function sentryWebpackUnpluginFactory() {
|
|
|
219
220
|
componentNameAnnotatePlugin: webpackComponentNameAnnotatePlugin(),
|
|
220
221
|
moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin(BannerPlugin),
|
|
221
222
|
debugIdInjectionPlugin: webpackDebugIdInjectionPlugin(BannerPlugin),
|
|
222
|
-
debugIdUploadPlugin: webpackDebugIdUploadPlugin
|
|
223
|
+
debugIdUploadPlugin: webpackDebugIdUploadPlugin,
|
|
223
224
|
bundleSizeOptimizationsPlugin: webpackBundleSizeOptimizationsPlugin(DefinePlugin)
|
|
224
225
|
});
|
|
225
226
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack4and5.mjs","sources":["../../src/webpack4and5.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n SentrySDKBuildFlags,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version\n// https://github.com/webpack/webpack/commit/65eca2e529ce1d79b79200d4bdb1ce1b81141459\n\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n contentHash?: {\n javascript?: string;\n };\n };\n}\n\ntype UnsafeBannerPlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\ntype UnsafeDefinePlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\nfunction webpackReleaseInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string): UnpluginOptions => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 webpackComponentNameAnnotatePlugin(): (ignoredComponents?: string[]) => UnpluginOptions {\n return (ignoredComponents?: string[]) => ({\n name: \"sentry-webpack-component-name-annotate-plugin\",\n enforce: \"pre\",\n // Webpack needs this hook for loader logic, so the plugin is not run on unsupported file types\n transformInclude(id) {\n return id.endsWith(\".tsx\") || id.endsWith(\".jsx\");\n },\n transform: createComponentNameAnnotateHooks(ignoredComponents).transform,\n });\n}\n\nfunction webpackBundleSizeOptimizationsPlugin(\n UnsafeDefinePlugin: UnsafeDefinePlugin | undefined\n): (replacementValues: SentrySDKBuildFlags) => UnpluginOptions {\n return (replacementValues: SentrySDKBuildFlags) => ({\n name: \"sentry-webpack-bundle-size-optimizations-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 DefinePlugin =\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-member-access\n compiler?.webpack?.DefinePlugin || UnsafeDefinePlugin;\n\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 DefinePlugin({\n ...replacementValues,\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): () => 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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 hash = arg?.chunk?.contentHash?.javascript ?? arg?.chunk?.hash;\n const debugId = hash ? stringToUUID(hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdUploadPlugin(): (\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n forceExitOnBuildCompletion?: boolean\n) => UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return (\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n forceExitOnBuildCompletion?: boolean\n ) => ({\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 if (forceExitOnBuildCompletion && compiler.options.mode === \"production\") {\n compiler.hooks.done.tap(pluginName, () => {\n setTimeout(() => {\n logger.debug(\"Exiting process after debug file upload\");\n process.exit(0);\n });\n });\n }\n },\n });\n}\n\nfunction webpackModuleMetadataInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string) => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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\n/**\n * The factory function accepts BannerPlugin and DefinePlugin classes in\n * order to avoid direct dependencies on webpack.\n *\n * This allow us to export version of the plugin for webpack 5.1+ and compatible environments.\n *\n * Since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version.\n */\nexport function sentryWebpackUnpluginFactory({\n BannerPlugin,\n DefinePlugin,\n}: {\n BannerPlugin?: UnsafeBannerPlugin;\n DefinePlugin?: UnsafeDefinePlugin;\n} = {}): ReturnType<typeof sentryUnpluginFactory> {\n return sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin(BannerPlugin),\n componentNameAnnotatePlugin: webpackComponentNameAnnotatePlugin(),\n moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin(BannerPlugin),\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin(BannerPlugin),\n debugIdUploadPlugin: webpackDebugIdUploadPlugin(),\n bundleSizeOptimizationsPlugin: webpackBundleSizeOptimizationsPlugin(DefinePlugin),\n });\n}\n\nexport type SentryWebpackPluginOptions = Options & {\n _experiments?: Options[\"_experiments\"] & {\n /**\n * If enabled, the webpack plugin will exit the build process after the build completes.\n * Use this with caution, as it will terminate the process.\n *\n * More information: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/345\n *\n * @default false\n */\n forceExitOnBuildCompletion?: boolean;\n };\n};\n"],"names":["webpackReleaseInjectionPlugin","UnsafeBannerPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","options","plugins","push","raw","include","banner","webpackComponentNameAnnotatePlugin","ignoredComponents","enforce","transformInclude","id","endsWith","transform","createComponentNameAnnotateHooks","webpackBundleSizeOptimizationsPlugin","UnsafeDefinePlugin","replacementValues","_compiler$webpack2","DefinePlugin","_objectSpread","webpackDebugIdInjectionPlugin","_compiler$webpack3","arg","_arg$chunk$contentHas","_arg$chunk","_arg$chunk$contentHas2","_arg$chunk2","hash","chunk","contentHash","javascript","debugId","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","pluginName","upload","logger","forceExitOnBuildCompletion","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","mode","done","tap","setTimeout","debug","process","exit","webpackModuleMetadataInjectionPlugin","_compiler$webpack4","sentryWebpackUnpluginFactory","_ref2","arguments","length","undefined","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","moduleMetadataInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;AACA;AAqBA,SAASA,6BAA6BA,CACpCC,kBAAkD,EACN;AAC5C,EAAA,OAAO,UAACC,aAAqB,EAAA;IAAA,OAAuB;AAClDC,MAAAA,IAAI,EAAE,yCAAyC;MAC/CC,OAAO,EAAA,SAAAA,OAACC,CAAAA,QAAQ,EAAE;AAAA,QAAA,IAAAC,iBAAA,CAAA;AAChB;AACA;AACA;AACA,QAAA,IAAMC,YAAY;AAChB;AACA;AACA;AACA,QAAA,CAAAF,QAAQ,KAARA,IAAAA,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IAAAA,6BAA6B,EAAEV,oCAAoC,CAAClE,YAAY,CAAC;AACjF6E,IAAAA,sBAAsB,EAAExD,6BAA6B,CAACrB,YAAY,CAAC;IACnE8E,mBAAmB,EAAE1C,0BAA0B,EAAE;IACjD2C,6BAA6B,EAAEhE,oCAAoC,CAACI,YAAY,CAAA;AAClF,GAAC,CAAC,CAAA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"webpack4and5.mjs","sources":["../../src/webpack4and5.ts"],"sourcesContent":["import {\n getDebugIdSnippet,\n Options,\n sentryUnpluginFactory,\n stringToUUID,\n SentrySDKBuildFlags,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport * as path from \"path\";\nimport { UnpluginOptions } from \"unplugin\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n// since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version\n// https://github.com/webpack/webpack/commit/65eca2e529ce1d79b79200d4bdb1ce1b81141459\n\ninterface BannerPluginCallbackArg {\n chunk?: {\n hash?: string;\n contentHash?: {\n javascript?: string;\n };\n };\n}\n\ntype UnsafeBannerPlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\ntype UnsafeDefinePlugin = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (options: any): unknown;\n};\n\nfunction webpackReleaseInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string): UnpluginOptions => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 webpackComponentNameAnnotatePlugin(): (ignoredComponents?: string[]) => UnpluginOptions {\n return (ignoredComponents?: string[]) => ({\n name: \"sentry-webpack-component-name-annotate-plugin\",\n enforce: \"pre\",\n // Webpack needs this hook for loader logic, so the plugin is not run on unsupported file types\n transformInclude(id) {\n return id.endsWith(\".tsx\") || id.endsWith(\".jsx\");\n },\n transform: createComponentNameAnnotateHooks(ignoredComponents).transform,\n });\n}\n\nfunction webpackBundleSizeOptimizationsPlugin(\n UnsafeDefinePlugin: UnsafeDefinePlugin | undefined\n): (replacementValues: SentrySDKBuildFlags) => UnpluginOptions {\n return (replacementValues: SentrySDKBuildFlags) => ({\n name: \"sentry-webpack-bundle-size-optimizations-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 DefinePlugin =\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-member-access\n compiler?.webpack?.DefinePlugin || UnsafeDefinePlugin;\n\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 DefinePlugin({\n ...replacementValues,\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): () => 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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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 hash = arg?.chunk?.contentHash?.javascript ?? arg?.chunk?.hash;\n const debugId = hash ? stringToUUID(hash) : uuidv4();\n return getDebugIdSnippet(debugId);\n },\n })\n );\n },\n });\n}\n\nfunction webpackDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void,\n forceExitOnBuildCompletion?: boolean\n): UnpluginOptions {\n const pluginName = \"sentry-webpack-debug-id-upload-plugin\";\n return {\n name: pluginName,\n webpack(compiler) {\n const freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();\n\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)\n .then(() => {\n callback();\n })\n .finally(() => {\n freeGlobalDependencyOnDebugIdSourcemapArtifacts();\n });\n });\n\n if (forceExitOnBuildCompletion && compiler.options.mode === \"production\") {\n compiler.hooks.done.tap(pluginName, () => {\n setTimeout(() => {\n logger.debug(\"Exiting process after debug file upload\");\n process.exit(0);\n });\n });\n }\n },\n };\n}\n\nfunction webpackModuleMetadataInjectionPlugin(\n UnsafeBannerPlugin: UnsafeBannerPlugin | undefined\n): (injectionCode: string) => UnpluginOptions {\n return (injectionCode: string) => ({\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 =\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-member-access\n compiler?.webpack?.BannerPlugin || UnsafeBannerPlugin;\n\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\n/**\n * The factory function accepts BannerPlugin and DefinePlugin classes in\n * order to avoid direct dependencies on webpack.\n *\n * This allow us to export version of the plugin for webpack 5.1+ and compatible environments.\n *\n * Since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version.\n */\nexport function sentryWebpackUnpluginFactory({\n BannerPlugin,\n DefinePlugin,\n}: {\n BannerPlugin?: UnsafeBannerPlugin;\n DefinePlugin?: UnsafeDefinePlugin;\n} = {}): ReturnType<typeof sentryUnpluginFactory> {\n return sentryUnpluginFactory({\n releaseInjectionPlugin: webpackReleaseInjectionPlugin(BannerPlugin),\n componentNameAnnotatePlugin: webpackComponentNameAnnotatePlugin(),\n moduleMetadataInjectionPlugin: webpackModuleMetadataInjectionPlugin(BannerPlugin),\n debugIdInjectionPlugin: webpackDebugIdInjectionPlugin(BannerPlugin),\n debugIdUploadPlugin: webpackDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: webpackBundleSizeOptimizationsPlugin(DefinePlugin),\n });\n}\n\nexport type SentryWebpackPluginOptions = Options & {\n _experiments?: Options[\"_experiments\"] & {\n /**\n * If enabled, the webpack plugin will exit the build process after the build completes.\n * Use this with caution, as it will terminate the process.\n *\n * More information: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/345\n *\n * @default false\n */\n forceExitOnBuildCompletion?: boolean;\n };\n};\n"],"names":["webpackReleaseInjectionPlugin","UnsafeBannerPlugin","injectionCode","name","webpack","compiler","_compiler$webpack","BannerPlugin","options","plugins","push","raw","include","banner","webpackComponentNameAnnotatePlugin","ignoredComponents","enforce","transformInclude","id","endsWith","transform","createComponentNameAnnotateHooks","webpackBundleSizeOptimizationsPlugin","UnsafeDefinePlugin","replacementValues","_compiler$webpack2","DefinePlugin","_objectSpread","webpackDebugIdInjectionPlugin","_compiler$webpack3","arg","_arg$chunk$contentHas","_arg$chunk","_arg$chunk$contentHas2","_arg$chunk2","hash","chunk","contentHash","javascript","debugId","stringToUUID","uuidv4","getDebugIdSnippet","webpackDebugIdUploadPlugin","upload","logger","createDependencyOnBuildArtifacts","forceExitOnBuildCompletion","pluginName","freeGlobalDependencyOnDebugIdSourcemapArtifacts","hooks","afterEmit","tapAsync","compilation","callback","_ref","outputPath","outputOptions","path","resolve","buildArtifacts","Object","keys","assets","map","asset","join","then","mode","done","tap","setTimeout","debug","process","exit","webpackModuleMetadataInjectionPlugin","_compiler$webpack4","sentryWebpackUnpluginFactory","_ref2","arguments","length","undefined","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","moduleMetadataInjectionPlugin","debugIdInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin"],"mappings":";;;;;;;;;;;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D,CAAA;GAAC,CAAA;AACJ,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS2E,4BAA4BA,GAMM;AAAA,EAAA,IAAAC,KAAA,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAA9C,EAAE;IALJxE,YAAY,GAAAuE,KAAA,CAAZvE,YAAY;IACZmB,YAAY,GAAAoD,KAAA,CAAZpD,YAAY,CAAA;AAKZ,EAAA,OAAOwD,qBAAqB,CAAC;AAC3BC,IAAAA,sBAAsB,EAAEnF,6BAA6B,CAACO,YAAY,CAAC;IACnE6E,2BAA2B,EAAEtE,kCAAkC,EAAE;AACjEuE,IAAAA,6BAA6B,EAAEV,oCAAoC,CAACpE,YAAY,CAAC;AACjF+E,IAAAA,sBAAsB,EAAE1D,6BAA6B,CAACrB,YAAY,CAAC;AACnEgF,IAAAA,mBAAmB,EAAE5C,0BAA0B;IAC/C6C,6BAA6B,EAAElE,oCAAoC,CAACI,YAAY,CAAA;AAClF,GAAC,CAAC,CAAA;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/webpack-plugin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"prepack": "ts-node ./src/prepack.ts"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@sentry/bundler-plugin-core": "3.
|
|
56
|
+
"@sentry/bundler-plugin-core": "3.5.0",
|
|
57
57
|
"unplugin": "1.0.1",
|
|
58
58
|
"uuid": "^9.0.0"
|
|
59
59
|
},
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@babel/preset-typescript": "7.17.12",
|
|
64
64
|
"@rollup/plugin-babel": "5.3.1",
|
|
65
65
|
"@rollup/plugin-commonjs": "22.0.1",
|
|
66
|
-
"@sentry-internal/eslint-config": "3.
|
|
67
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.
|
|
66
|
+
"@sentry-internal/eslint-config": "3.5.0",
|
|
67
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "3.5.0",
|
|
68
68
|
"@swc/core": "^1.2.205",
|
|
69
69
|
"@swc/jest": "^0.2.21",
|
|
70
70
|
"@types/jest": "^28.1.3",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"eslint": "^8.18.0",
|
|
75
75
|
"jest": "^28.1.1",
|
|
76
76
|
"rimraf": "^3.0.2",
|
|
77
|
-
"rollup": "2.
|
|
77
|
+
"rollup": "2.79.2",
|
|
78
78
|
"ts-node": "^10.9.1",
|
|
79
79
|
"typescript": "^4.7.4",
|
|
80
80
|
"webpack": "npm:webpack@^4"
|