Skip to content

Commit 1cad78e

Browse files
committed
Get the path from sentry-cli
1 parent 21c64ac commit 1cad78e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* eslint-disable max-lines */
2+
// eslint-disable-next-line import/no-extraneous-dependencies
3+
import SentryCLI from '@sentry/cli';
24
import { getSentryRelease } from '@sentry/node';
35
import { arrayify, dropUndefinedKeys, escapeStringForRegex, logger } from '@sentry/utils';
46
import { default as SentryWebpackPlugin } from '@sentry/webpack-plugin';
@@ -464,12 +466,7 @@ export function getWebpackPluginOptions(
464466
* ref: https://github.com/vercel/nft/issues/203
465467
*/
466468
function ensureCLIBinaryExists(): boolean {
467-
for (const node_modulesPath of module.paths) {
468-
if (fs.existsSync(path.resolve(node_modulesPath, '@sentry/cli/sentry-cli'))) {
469-
return true;
470-
}
471-
}
472-
return false;
469+
return fs.existsSync(SentryCLI.getPath());
473470
}
474471

475472
/** Check various conditions to decide if we should run the plugin */

0 commit comments

Comments
 (0)