[data-reveal]{opacity:1!important;transform:none!important}
build
Frontend

build

Build the production frontend from the modules a backend serves, with the secrets it needs and the cache it never uses silently.

ajs dms build builds the production frontend for one backend: the client bundle, its compressed copies, the server-rendering bundle, the e-mail bundle and the bundle of the modules' server routes.

$ ajs dms build --help
Usage: ajs dms build [options]

Build the production frontend from the manifest and layers archive the backend
serves, into the workspace's dist directory. Needs a DMS_SESSION_SECRET of 32
characters or more.

Options:
  -b, --backend-url <url>      Backend URL to build for; required, as -b or the
                               variable (env: DMS_API_BASE_URL)
  -f, --force                  Extract the layers archive from scratch and
                               reinstall the workspace dependencies
  --offline                    Build from the last cached manifest and layers
                               archive, without the backend (env: DMS_OFFLINE)
  --bootstrap-secret <secret>  Credential for the backend's layer endpoints;
                               prefer the variable, a command line is visible to
                               other processes (env: DMS_BOOTSTRAP_SECRET)
  -h, --help                   Show help for a command

Before you build

build needs three values. Keep them in the environment or the project's .env, never on the command line:

  • DMS_API_BASE_URL (or -b): the backend to build for. build never discovers it.
  • DMS_SESSION_SECRET: 32 characters or more. start needs the same value, so sessions survive restarts. Generate one with openssl rand -hex 32.
  • DMS_BOOTSTRAP_SECRET: the backend's frontend.bootstrapSecret. build never reads the development credential from .antelope/dms-dev.json.
A backend that configures no bootstrap secret answers an anonymous build without the modules' private options, their declared backend proxies and the secrets the frontend server needs, and the build succeeds anyway. start then warns that e-mail renders and OAuth sign-in will be refused, and only the proxies the modules' own dms.server.ts declare are served. Always build with the backend's credential.

A build

$ ajs dms build -b http://localhost:5050
ajs dms build  http://localhost:5050 · production
✔ Workspace ready 9.3s
ℹ Building for production
  Workspace  ~/.antelopejs/dms-frontend/8532f40f…
✔ Built the client bundle 1m 38s
✔ Compressed the client assets 32.2s
✔ Built the SSR bundle 1m 35s
✔ Built the e-mail bundle 3.6s
✔ Built the server modules 2.8s
▲ 1 Vite warning
  → Run with --verbose to list them

Built the production frontend → ~/.antelopejs/dms-frontend/8532f40f…/dist · 4m 01s

Next steps
  ajs dms start -b http://localhost:5050  with the DMS_SESSION_SECRET this build used

The steps write into the workspace's dist/ directory:

StepOutput
Client bundledist/client, the browser application
Compressed assetsPre-compressed copies of the client assets, which the server sends to browsers that accept them
SSR bundledist/ssr, the server renderer
E-mail bundledist/server, the e-mail renderer and its translation catalogs under dist/server/locales/
Server modulesdist/server-modules, the modules' dms.server.ts and what they import

A step that fails stops the build, prints the error Vite reported, or the last lines of the step's output, and points at the file in the frontend module rather than its copy in the workspace. --verbose streams every line of every step.

Without the backend

The output of build is deployed, so it never builds silently from the cache. When the backend cannot be reached or fails, build exits 1, says whether a cached manifest exists and how old it is, and builds from it only when you pass --offline. The cached build then warns that its output may not match the current backend.

--offline needs a layers archive that an earlier online build downloaded for the same workspace:

✖ No layers archive was downloaded for this workspace
  → Run once without --offline, with the backend reachable, first

Forcing a clean build

build reinstalls the workspace dependencies only when the modules' dependencies changed. --force extracts the layers archive from scratch and reinstalls them. To start from an empty workspace, run ajs dms clean -b <url> first.

Next

Serve the build with ajs dms start, or read Production for a complete deployment.