-
Notifications
You must be signed in to change notification settings - Fork 9
Description
From Tim Neutkens:
One quick optimization you can do for your app is removing
pnpm startand usingoutput: standaloneor changing the command to./node_modules/.bin/next startinstead, that saves about 50MB in RSS
The output: 'standalone' docs say:
Next.js can automatically create a
standalonefolder that copies only the necessary files for a production deployment including select files innode_modules.This will create a folder at
.next/standalonewhich can then be deployed on its own without installingnode_modules.Additionally, a minimal
server.jsfile is also output which can be used instead ofnext start. This minimal server does not copy thepublicor.next/staticfolders by default as these should ideally be handled by a CDN instead, although these folders can be copied to thestandalone/publicandstandalone/.next/staticfolders manually, after whichserver.jsfile will serve these automatically.