Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/nextjs/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ export default [
// the name doesn't match an SDK dependency)
packageSpecificConfig: {
external: ['next/router', 'next/constants', 'next/headers', 'stacktrace-parser'],

// Next.js and our users are more happy when our client code has the "use client" directive
plugins: [
{
name: 'sentry-internal-add-use-client-directive-to-client-entry-points-plugin-extravaganza',
banner: chunk => {
if (
chunk.isEntry &&
(chunk.facadeModuleId.endsWith('/src/index.client.ts') ||
chunk.facadeModuleId.endsWith('/src/client/index.ts'))
) {
return '"use client";';
}
},
},
],
},
}),
),
Expand Down
Loading