rembrembdocs

serverExternalPackages

Last updated April 23, 2026

Opt-out specific dependencies from being included in the automatic bundling of the bundlePagesRouterDependencies option.

These pages will then use native Node.js require to resolve the dependency.

next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  serverExternalPackages: ['@acme/ui'],
}
 
module.exports = nextConfig

Next.js includes a short list of popular packages that currently are working on compatibility and automatically opt-ed out:

Was this helpful?