Next.js 8 now supports serverless apps
Next.js 8 enables serverless deployment, in which applications are split into smaller parts, or lambdas, that let code be run on demand and scale automatically. In Next.js Version 8, each page in the
pages directory becomes a serverless lambda. A low-level API is available for serverless deployment.
Other new and improved features in Next.js Version 8 include:
- Build-time memory usage reduction, made via contributions to the Webpack module bundler. This has resulted in 16 times better memory usage without any degradation in performance, according to developer Zeit.
- Prefetch performance improvements, with the Next.js router enabling prefetching of pages for quicker navigation.
- Smaller HTML size, with the initial payload size reduced.
- Faster static export, in which static rendering through
next exportwill be faster on multi-CPU machines. Static rendering is done to output files that can be served directly without code execution on the server. The number of CPU cores will be detected automatically and pages distributed accordingly.
script-src unsafe-inlinein their policy, with Next.js creating an inline