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
| Option | Alias | Description |
|---|---|---|
--port | -p | Custom port |
--name | -n | Instance name |
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
| Command | What it does |
|---|---|
restart | Only restarts PM2 process (fast, ~1s) |
rebuild | Builds + restarts (slower, ~30-60s) |
restart for configuration changes, use rebuild for code changes.