---
title: bundlePagesRouterDependencies
description: Enable automatic dependency bundling for Pages Router
url: "https://nextjs.org/docs/15/pages/api-reference/config/next-config-js/bundlePagesRouterDependencies"
version: 15.5.15
lastUpdated: 2025-04-15
prerequisites:
  - "Configuration: /docs/15/pages/api-reference/config"
  - "next.config.js Options: /docs/15/pages/api-reference/config/next-config-js"
---


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

```js filename="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`](/docs/pages/api-reference/config/next-config-js/serverExternalPackages) option.

## Version History

| Version   | Changes                                                                                                   |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `v15.0.0` | Moved from experimental to stable. Renamed from `bundlePagesExternals` to `bundlePagesRouterDependencies` |
---

For an index of all available documentation, see [/docs/15/llms.txt](/docs/15/llms.txt)