Next.js 5.1: Faster Page Resolution
Mar 26, 2018

Summary
Next.js 5.1 introduces major performance improvements by simplifying page resolution logic, achieving a 102x speedup (from 2.347ms to 0.023ms). It adds `publicRuntimeConfig` and `serverRuntimeConfig` for environment configuration, making variables accessible on both server and client, or server-only respectively. Error handling is refactored to automatically reload pages on 404s from page bundles, improving compatibility with CDNs. `next.config.js` now supports exporting a function to conditionally load configurations based on build phases. Production source map generation is improved, and a new plugin `@zeit/next-bundle-analyzer` is introduced, alongside enhancements to existing CSS/Less/Sass plugins.