diff --git a/.github/workflows/deploy_cfwebapp_to_azure.yml b/.github/workflows/deploy_cfwebapp_to_azure.yml index 645d5f9f9..883c3d699 100644 --- a/.github/workflows/deploy_cfwebapp_to_azure.yml +++ b/.github/workflows/deploy_cfwebapp_to_azure.yml @@ -71,16 +71,21 @@ jobs: working-directory: js run: | pnpm --filter codeflash-webapp build - # pnpm hoists shared deps to the workspace root node_modules/. - # Merge them into cf-webapp/node_modules/ so the zip is self-contained. - rsync -a --ignore-existing node_modules/ cf-webapp/node_modules/ - cd cf-webapp && zip -qr cfwebapp.zip . .next node_modules package.json public + # 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 . - name: Upload artifact for deployment jobs uses: actions/upload-artifact@v7 with: name: cfwebapp-artifact - path: js/cf-webapp/cfwebapp.zip + path: js/deploy-output/cfwebapp.zip deploy: runs-on: ubuntu-latest diff --git a/js/.npmrc b/js/.npmrc index c73f0ec6b..feb64d643 100644 --- a/js/.npmrc +++ b/js/.npmrc @@ -1,2 +1 @@ @codeflash-ai:registry=https://npm.pkg.github.com -node-linker=hoisted diff --git a/js/cf-webapp/next.config.mjs b/js/cf-webapp/next.config.mjs index 57f0efd19..964526d77 100644 --- a/js/cf-webapp/next.config.mjs +++ b/js/cf-webapp/next.config.mjs @@ -54,6 +54,10 @@ const nextConfig = { expire: 600, // 10 minutes }, }, + output: "standalone", + // Point to the monorepo root so standalone trace includes all deps + // (pnpm stores them in js/node_modules/.pnpm outside cf-webapp/). + outputFileTracingRoot: resolve(__dirname, ".."), transpilePackages: ["@codeflash-ai/common"], webpack: (config, { isServer }) => { config.watchOptions = {