Skip to content

Commit 547fccf

Browse files
committed
fix: avoid adding defne plugins if no treeshake opts specified
1 parent bf868fb commit 547fccf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,5 +941,8 @@ function setupTreeshakingFromConfig(
941941
defines.__SENTRY_EXCLUDE_REPLAY_WORKER__ = true;
942942
}
943943

944-
newConfig.plugins.push(new buildContext.webpack.DefinePlugin(defines));
944+
// Only add DefinePlugin if there are actual defines to set
945+
if (Object.keys(defines).length > 0) {
946+
newConfig.plugins.push(new buildContext.webpack.DefinePlugin(defines));
947+
}
945948
}

0 commit comments

Comments
 (0)