Skip to content
This page is also available as Markdown: request this page's URL with an Accept: text/markdown header. For an index of Next.js Pages Router documentation, see /docs/pages/llms.txt.
You are currently viewing the documentation for Pages Router.

bundlePagesRouterDependencies

Last updated April 15, 2025

Enable automatic server-side dependency bundling for Pages Router applications. Matches the automatic dependency bundling in App Router.

next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
  bundlePagesRouterDependencies: true,
}
 
module.exports = nextConfig

Explicitly opt-out certain packages from being bundled using the serverExternalPackages option.

Version History

VersionChanges
v15.0.0Moved from experimental to stable. Renamed from bundlePagesExternals to bundlePagesRouterDependencies

Was this helpful?

supported.