File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,8 @@ export function constructWebpackConfigFunction(
332
332
// Symbolication for dev-mode errors is done elsewhere.
333
333
if ( ! isDev ) {
334
334
// eslint-disable-next-line @typescript-eslint/no-explicit-any
335
- const { sentryWebpackPlugin } = loadModule ( '@sentry/webpack-plugin' ) as any ;
335
+ const { sentryWebpackPlugin } = loadModule < { sentryWebpackPlugin : any } > ( '@sentry/webpack-plugin' ) ?? { } ;
336
+
336
337
if ( sentryWebpackPlugin ) {
337
338
if ( ! userSentryOptions . sourcemaps ?. disable ) {
338
339
// `hidden-source-map` produces the same sourcemaps as `source-map`, but doesn't include the `sourceMappingURL`
Original file line number Diff line number Diff line change @@ -52,11 +52,13 @@ export function loadModule<T>(moduleName: string): T | undefined {
52
52
// no-empty
53
53
}
54
54
55
- try {
56
- const { cwd } = dynamicRequire ( module , 'process' ) ;
57
- mod = dynamicRequire ( module , `${ cwd ( ) } /node_modules/${ moduleName } ` ) as T ;
58
- } catch ( e ) {
59
- // no-empty
55
+ if ( ! mod ) {
56
+ try {
57
+ const { cwd } = dynamicRequire ( module , 'process' ) ;
58
+ mod = dynamicRequire ( module , `${ cwd ( ) } /node_modules/${ moduleName } ` ) as T ;
59
+ } catch ( e ) {
60
+ // no-empty
61
+ }
60
62
}
61
63
62
64
return mod ;
You can’t perform that action at this time.
0 commit comments