Skip to content

Commit de2ac55

Browse files
committed
clean up newEntryProperty
1 parent a6b87aa commit de2ac55

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ async function addSentryToEntryProperty(
140140
// we know is that it won't have gotten *simpler* in form, so we only need to worry about the object and function
141141
// options. See https://webpack.js.org/configuration/entry-context/#entry.
142142

143-
let newEntryProperty = currentEntryProperty;
144-
if (typeof currentEntryProperty === 'function') {
145-
newEntryProperty = await currentEntryProperty();
146-
}
147-
newEntryProperty = newEntryProperty as EntryPropertyObject;
143+
const newEntryProperty =
144+
typeof currentEntryProperty === 'function' ? await currentEntryProperty() : { ...currentEntryProperty };
148145

149146
// Add a new element to the `entry` array, we force webpack to create a bundle out of the user's
150147
// `sentry.server.config.js` file and output it to `SERVER_INIT_LOCATION`. (See

0 commit comments

Comments
 (0)