|
1 | 1 | /* eslint-disable complexity */
|
2 | 2 | /* eslint-disable max-lines */
|
3 | 3 | import { getSentryRelease } from '@sentry/node';
|
4 |
| -import { arrayify, dropUndefinedKeys, escapeStringForRegex, loadModule, logger } from '@sentry/utils'; |
| 4 | +import { arrayify, dropUndefinedKeys, escapeStringForRegex, logger } from '@sentry/utils'; |
| 5 | +import { default as SentryWebpackPlugin } from '@sentry/webpack-plugin'; |
5 | 6 | import * as chalk from 'chalk';
|
6 | 7 | import * as fs from 'fs';
|
7 | 8 | import * as path from 'path';
|
@@ -312,11 +313,8 @@ export function constructWebpackConfigFunction(
|
312 | 313 | // without, the option to use `hidden-source-map` only applies to the client-side build.
|
313 | 314 | newConfig.devtool = userSentryOptions.hideSourceMaps && !isServer ? 'hidden-source-map' : 'source-map';
|
314 | 315 |
|
315 |
| - const SentryWebpackPlugin = loadModule('@sentry/webpack-plugin'); |
316 |
| - |
317 | 316 | newConfig.plugins = newConfig.plugins || [];
|
318 | 317 | newConfig.plugins.push(
|
319 |
| - // @ts-expect-error - this exists, the dynamic import just doesn't know about it |
320 | 318 | new SentryWebpackPlugin(
|
321 | 319 | getWebpackPluginOptions(buildContext, userSentryWebpackPluginOptions, userSentryOptions),
|
322 | 320 | ),
|
@@ -769,9 +767,6 @@ function shouldEnableWebpackPlugin(buildContext: BuildContext, userSentryOptions
|
769 | 767 | // architecture-specific version of the `sentry-cli` binary. If `yarn install`, `npm install`, or `npm ci` are run
|
770 | 768 | // with the `--ignore-scripts` option, this will be blocked and the missing binary will cause an error when users
|
771 | 769 | // try to build their apps.
|
772 |
| - const SentryWebpackPlugin = loadModule('@sentry/webpack-plugin'); |
773 |
| - |
774 |
| - // @ts-expect-error - this exists, the dynamic import just doesn't know it |
775 | 770 | if (!SentryWebpackPlugin.cliBinaryExists()) {
|
776 | 771 | // eslint-disable-next-line no-console
|
777 | 772 | console.error(
|
|
0 commit comments