orphelix rebuild
Rebuild the Next.js application and restart PM2 process. This is useful after making code changes.What it does
Therebuild command performs four steps:
- Update Dependencies - Checks for and updates outdated dev dependencies
- Build - Runs
npm run buildto create production build - Sync Assets - Copies static assets to standalone build
- Restart - Restarts the PM2 process with new code
Usage
Options
Example
When to use
Userebuild when:
- You’ve made code changes and want to deploy them
- You’ve pulled latest changes from git
- You’ve updated dependencies
- You need a fresh build
Difference from restart
Use
restart for configuration changes, use rebuild for code changes.