{"version":3,"file":"index.js","sources":["../../../src/webpack/index.ts"],"sourcesContent":["import type { SentryWebpackPluginOptions } from './webpack4and5';\nimport { sentryWebpackPluginFactory } from './webpack4and5';\nimport { createRequire } from 'node:module';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype PluginClass = new (options: any) => unknown;\n\ntype WebpackModule = {\n BannerPlugin?: PluginClass;\n DefinePlugin?: PluginClass;\n default?: WebpackModule;\n};\n\n// `webpack` is an optional peer dependency. We require it lazily so the plugin doesn't\n// crash on load in bundlers that don't ship `webpack` (e.g. rspack) — those provide\n// the plugin classes via `compiler.webpack` at runtime instead.\nfunction loadWebpack(): WebpackModule {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore Rollup transpiles import.meta for CJS\n return createRequire(import.meta.url)('webpack') as WebpackModule;\n } catch {\n return {};\n }\n}\n\nconst webpack = loadWebpack();\nconst BannerPlugin = webpack.BannerPlugin ?? webpack.default?.BannerPlugin;\nconst DefinePlugin = webpack.DefinePlugin ?? webpack.default?.DefinePlugin;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options?: SentryWebpackPluginOptions) => any = sentryWebpackPluginFactory({\n BannerPlugin,\n DefinePlugin,\n});\n\nexport { sentryCliBinaryExists } from '../core';\n\nexport type { SentryWebpackPluginOptions };\n"],"names":[],"mappings":";;;;AAgBA,SAAS,WAAA,GAA6B;AACpC,EAAA,IAAI;AAGF,IAAA,OAAO,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA,CAAE,SAAS,CAAA;AAAA,EACjD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AAEA,MAAM,UAAU,WAAA,EAAY;AAC5B,MAAM,YAAA,GAAe,OAAA,CAAQ,YAAA,IAAgB,OAAA,CAAQ,OAAA,EAAS,YAAA;AAC9D,MAAM,YAAA,GAAe,OAAA,CAAQ,YAAA,IAAgB,OAAA,CAAQ,OAAA,EAAS,YAAA;AAGvD,MAAM,sBAAqE,0BAAA,CAA2B;AAAA,EAC3G,YAAA;AAAA,EACA;AACF,CAAC;;;;"}