Description
From Tim Neutkens:
One quick optimization you can do for your app is removing
pnpm start
and usingoutput: standalone
or changing the command to./node_modules/.bin/next start
instead, that saves about 50MB in RSS
The output: 'standalone'
docs say:
Next.js can automatically create a
standalone
folder that copies only the necessary files for a production deployment including select files innode_modules
.This will create a folder at
.next/standalone
which can then be deployed on its own without installingnode_modules
.Additionally, a minimal
server.js
file is also output which can be used instead ofnext start
. This minimal server does not copy thepublic
or.next/static
folders by default as these should ideally be handled by a CDN instead, although these folders can be copied to thestandalone/public
andstandalone/.next/static
folders manually, after whichserver.js
file will serve these automatically.