fix: remove .next/server copy that breaks standalone middleware-manifest
The standalone build already includes the correct server files. Copying .next/server on top was overwriting middleware-manifest.json, causing MODULE_NOT_FOUND errors at runtime. v1.22.1
This commit is contained in:
parent
e3c9f56608
commit
ef61ec3c20
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "my-weekly-todo-list",
|
"name": "my-weekly-todo-list",
|
||||||
"version": "1.22.0",
|
"version": "1.22.1",
|
||||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -53,11 +53,10 @@ if [ ! -d "$NEXT_DIR" ] || [ "$LOCAL" != "$REMOTE" ]; then
|
|||||||
log "Building application..."
|
log "Building application..."
|
||||||
npm run build 2>&1 | tee -a "$LOG_FILE"
|
npm run build 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
|
||||||
log "Preparing standalone directory (copying static, server assets and env)..."
|
log "Preparing standalone directory (copying static assets and env)..."
|
||||||
cp -r public .next/standalone/ 2>&1 | tee -a "$LOG_FILE"
|
cp -r public .next/standalone/ 2>&1 | tee -a "$LOG_FILE"
|
||||||
mkdir -p .next/standalone/.next/static 2>&1 | tee -a "$LOG_FILE"
|
mkdir -p .next/standalone/.next/static 2>&1 | tee -a "$LOG_FILE"
|
||||||
cp -r .next/static .next/standalone/.next/ 2>&1 | tee -a "$LOG_FILE"
|
cp -r .next/static .next/standalone/.next/ 2>&1 | tee -a "$LOG_FILE"
|
||||||
cp -r .next/server .next/standalone/.next/ 2>&1 | tee -a "$LOG_FILE"
|
|
||||||
cp .env .next/standalone/ 2>/dev/null || true 2>&1 | tee -a "$LOG_FILE"
|
cp .env .next/standalone/ 2>/dev/null || true 2>&1 | tee -a "$LOG_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -28,11 +28,10 @@ npx prisma generate
|
|||||||
echo -e "${YELLOW}[4/6] Building application...${NC}"
|
echo -e "${YELLOW}[4/6] Building application...${NC}"
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
echo -e "${YELLOW}[5/6] Copying static + server assets to standalone...${NC}"
|
echo -e "${YELLOW}[5/6] Copying static assets to standalone...${NC}"
|
||||||
cp -r public .next/standalone/
|
cp -r public .next/standalone/
|
||||||
mkdir -p .next/standalone/.next/static
|
mkdir -p .next/standalone/.next/static
|
||||||
cp -r .next/static .next/standalone/.next/
|
cp -r .next/static .next/standalone/.next/
|
||||||
cp -r .next/server .next/standalone/.next/
|
|
||||||
cp .env .next/standalone/ 2>/dev/null || true
|
cp .env .next/standalone/ 2>/dev/null || true
|
||||||
cp .env.local .next/standalone/ 2>/dev/null || true
|
cp .env.local .next/standalone/ 2>/dev/null || true
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user