@@ -446,36 +446,18 @@ export function getWebpackPluginOptions(
446446 return { ...defaultPluginOptions , ...userPluginOptions } ;
447447}
448448
449- /**
450- * NOTE: We're faking `require.resolve` here as a workaround for @vercel/nft detecting the binary itself as a hard
451- * dependency and always including it in the bundle, which is not what we want.
452- *
453- * ref: https://github.com/getsentry/sentry-javascript/issues/3865
454- * ref: https://github.com/vercel/nft/issues/203
455- */
456- function ensureCLIBinaryExists ( ) : boolean {
457- for ( const node_modulesPath of module . paths ) {
458- if ( fs . existsSync ( path . resolve ( node_modulesPath , '@sentry/cli/sentry-cli' ) ) ) {
459- return true ;
460- }
461- }
462- return false ;
463- }
464-
465449/** Check various conditions to decide if we should run the plugin */
466450function shouldEnableWebpackPlugin ( buildContext : BuildContext , userSentryOptions : UserSentryOptions ) : boolean {
467451 const { isServer, dev : isDev } = buildContext ;
468452 const { disableServerWebpackPlugin, disableClientWebpackPlugin } = userSentryOptions ;
469453
470454 /** Non-negotiable */
471455
472- // TODO: this is a hack to fix https://github.com/getsentry/sentry-cli/issues/1085, which is caused by
473- // https://github.com/getsentry/sentry-cli/issues/915. Once the latter is addressed, this existence check can come
474- // out. (The check is necessary because currently, `@sentry/cli` uses a post-install script to download an
456+ // This check is necessary because currently, `@sentry/cli` uses a post-install script to download an
475457 // architecture-specific version of the `sentry-cli` binary. If `yarn install`, `npm install`, or `npm ci` are run
476458 // with the `--ignore-scripts` option, this will be blocked and the missing binary will cause an error when users
477- // try to build their apps.)
478- if ( ! ensureCLIBinaryExists ( ) ) {
459+ // try to build their apps.
460+ if ( ! SentryWebpackPlugin . cliBinaryExists ( ) ) {
479461 return false ;
480462 }
481463
0 commit comments