The package is the stage directory .zcode-site/stage/, packed by zcode-site deploy. The stage root becomes /app in the cloud and must contain start.sh. Put in it only what the running site needs.
Static site
stage/
├── start.sh # from templates/static.sh
├── static-server.mjs # from templates/static-server.mjs
└── dist/ # build output (index.html, assets/…)
Node server
stage/
├── start.sh # from templates/node.sh
├── package.json # keep it: "type": "module" and package imports depend on it
├── <build output> # dist/, build/, .output/, .next/ … whatever the entry needs
└── node_modules/ # production dependencies, installed for linux x64
Self-contained server outputs (standalone builds, node adapters) bring their own trimmed node_modules; see app-types.md.
Python server
stage/
├── start.sh # from templates/python.sh
├── <application code> # main.py, app/, mysite/, templates/, static/ …
└── vendor/ # dependencies, linux x86-64 wheels for Python 3.12
.env, .env.* (except *.example) — secrets. deploy refuses them..git/, .zcode-site.json, .DS_Store, __pycache__/ — deploy always drops these.typescript, vite, webpack, eslint, @types/*, pytest)..next/cache, .turbo, .cache, .parcel-cache, .svelte-kit (except the build output), coverage/, node_modules/.cache, virtualenvs (.venv/, venv/), local SQLite files with the user's private data.deploy reports these.Copy what is needed into the stage instead of packing the project root and excluding things — an allow-list can't leak a file you didn't think of.
pnpm (and npm workspaces / yarn PnP) lay out node_modules with symlinks pointing outside the directory. deploy follows symlinks, so links inside the stage become real files — but the targets must exist. Simplest reliable options, in order:
node_modules.pnpm install --prod --frozen-lockfile --config.node-linker=hoisted inside the stage.nodeLinker: node-modules in the stage, or use npm.Never copy the project's own node_modules into the stage: it contains dev dependencies and binaries built for the local machine.
Before creating anything, zcode-site deploy checks the stage and lists every problem at once in error.data.problems (PACKAGE_CHECK_FAILED); each says what to change. Don't work around a check by dropping files the app needs. The checks mirror the server preflight (PACKAGE_INVALID): root start.sh with LF endings, no /.__zcode, no broken symlinks or .env files, dependencies present for package.json / requirements.txt, the size, count and depth limits, and every native binary linux x86-64.
Foreign binaries that are never loaded. Some packages ship prebuilt binaries for every platform side by side (prebuilds/darwin-arm64/… next to prebuilds/linux-x64/…). Once you have confirmed the linux-x64 variant is there, delete the foreign ones from the stage (preferred, it also shrinks the package) or deploy with --allow-foreign-binaries.
When a limit is exceeded, in this order:
--omit=dev, --prod, no -r requirements-dev.txt).npx esbuild src/server.ts --bundle --platform=node --target=node24 --format=esm --outfile=.zcode-site/stage/server.mjs --external:better-sqlite3 --external:sharp
(ESM bundles of CommonJS dependencies may need --banner:js="import { createRequire } from 'module'; const require = createRequire(import.meta.url);"). Run zcode-site check to make sure nothing is missing.*.map source maps of dependencies, docs/, test/, examples/ inside dependencies. Check before deleting anything you are unsure about.If the app is still too large (for example it needs PyTorch, TensorFlow, Chromium or a large model file), it can't run on ZCode Sites; tell the user.