fix: preserve pnpm symlinks in standalone zip for Azure deployment

Use zip -y to preserve symlinks in the standalone output. Azure Linux
App Service mounts the zip via SquashFS which supports symlinks. This
keeps the pnpm .pnpm/ structure intact so next can resolve peer deps
like @swc/helpers and @next/env from their co-located positions.

Also re-add node-linker=hoisted to .npmrc per pnpm docs recommendation
for environments that need standard node_modules resolution.
This commit is contained in:
Kevin Turcios 2026-04-15 07:41:19 -05:00
parent ae9e3011e7
commit 3f7baf9ab3
2 changed files with 10 additions and 10 deletions

View file

@ -71,21 +71,20 @@ jobs:
working-directory: js
run: |
pnpm --filter codeflash-webapp build
# Next.js standalone output traces runtime deps into .next/standalone/.
# outputFileTracingRoot is set to the workspace root (js/), so the
# layout is: standalone/{cf-webapp/,node_modules/,common/}.
# Dereference pnpm symlinks (cp -rL) so the zip is self-contained,
# then add static assets that standalone doesn't include.
cp -rL cf-webapp/.next/standalone deploy-output
cp -r cf-webapp/.next/static deploy-output/cf-webapp/.next/static
cp -r cf-webapp/public deploy-output/cf-webapp/public
cd deploy-output && zip -qr cfwebapp.zip .
# Next.js standalone output traces only runtime deps into
# .next/standalone/. outputFileTracingRoot is the workspace root,
# so the layout mirrors the monorepo: cf-webapp/, node_modules/, common/.
# Use zip -y to preserve pnpm symlinks — Azure Linux SquashFS supports them.
# Then add static assets that standalone doesn't include.
cp -r cf-webapp/.next/static cf-webapp/.next/standalone/cf-webapp/.next/static
cp -r cf-webapp/public cf-webapp/.next/standalone/cf-webapp/public
cd cf-webapp/.next/standalone && zip -qry cfwebapp.zip .
- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v7
with:
name: cfwebapp-artifact
path: js/deploy-output/cfwebapp.zip
path: js/cf-webapp/.next/standalone/cfwebapp.zip
deploy:
runs-on: ubuntu-latest

View file

@ -1 +1,2 @@
@codeflash-ai:registry=https://npm.pkg.github.com
node-linker=hoisted