@@ -6,7 +6,7 @@
|
||||
|
||||
```bash
|
||||
# Install Vercel CLI
|
||||
npm i -g vercel
|
||||
bun --bun i -g vercel
|
||||
|
||||
# Deploy
|
||||
vercel
|
||||
@@ -21,7 +21,7 @@ vercel --prod
|
||||
{
|
||||
"buildCommand": "next build",
|
||||
"devCommand": "next dev",
|
||||
"installCommand": "npm install",
|
||||
"installCommand": "bun --bun install",
|
||||
"framework": "nextjs",
|
||||
"regions": ["iad1"],
|
||||
"env": {
|
||||
@@ -88,7 +88,7 @@ module.exports = nextConfig
|
||||
|
||||
```bash
|
||||
# Build
|
||||
npm run build
|
||||
bun --bun run build
|
||||
|
||||
# The standalone folder contains everything needed
|
||||
# Copy these to your server:
|
||||
@@ -97,20 +97,20 @@ npm run build
|
||||
# - public/
|
||||
|
||||
# Run on server
|
||||
node .next/standalone/server.js
|
||||
bun --bun .next/standalone/server.js
|
||||
```
|
||||
|
||||
### Node.js Server
|
||||
|
||||
```bash
|
||||
# Build
|
||||
npm run build
|
||||
bun --bun run build
|
||||
|
||||
# Start production server
|
||||
npm start
|
||||
bun --bun start
|
||||
|
||||
# With PM2 for process management
|
||||
pm2 start npm --name "nextjs" -- start
|
||||
pm2 start bun --bun --name "nextjs" -- start
|
||||
pm2 startup
|
||||
pm2 save
|
||||
```
|
||||
@@ -126,7 +126,7 @@ RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
RUN bun --bun ci
|
||||
|
||||
# Stage 2: Builder
|
||||
FROM node:20-alpine AS builder
|
||||
@@ -136,7 +136,7 @@ COPY . .
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
RUN npm run build
|
||||
RUN bun --bun run build
|
||||
|
||||
# Stage 3: Runner
|
||||
FROM node:20-alpine AS runner
|
||||
@@ -298,13 +298,13 @@ module.exports = nextConfig
|
||||
|
||||
```bash
|
||||
# Install analyzer
|
||||
npm install -D @next/bundle-analyzer
|
||||
bun --bun install -D @next/bundle-analyzer
|
||||
|
||||
# Analyze
|
||||
ANALYZE=true npm run build
|
||||
ANALYZE=true bun --bun run build
|
||||
|
||||
# Or use built-in
|
||||
npm run build -- --experimental-build-mode=compile
|
||||
bun --bun run build -- --experimental-build-mode=compile
|
||||
```
|
||||
|
||||
### Performance Monitoring
|
||||
@@ -474,13 +474,13 @@ jobs:
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
run: bun --bun ci
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
run: bun --bun test
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
run: bun --bun run build
|
||||
env:
|
||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
|
||||
|
||||
Reference in New Issue
Block a user