Skip to content

Commit 66aa19c

Browse files
committed
fix: avoid adding defne plugins if no treeshake opts specified
1 parent 76426a9 commit 66aa19c

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
@@ -944,5 +944,8 @@ function setupTreeshakingFromConfig(
944944
defines.__SENTRY_EXCLUDE_REPLAY_WORKER__ = true;
945945
}
946946

947-
newConfig.plugins.push(new buildContext.webpack.DefinePlugin(defines));
947+
// Only add DefinePlugin if there are actual defines to set
948+
if (Object.keys(defines).length > 0) {
949+
newConfig.plugins.push(new buildContext.webpack.DefinePlugin(defines));
950+
}
948951
}

0 commit comments

Comments
 (0)