Building for Platform
Build a platform package with GxP Dev Tools, then deliver it through the app's Git, Build and Publish workflow. A development preview and a production package serve different purposes.
Use the scaffold build script
The current toolkit packages app output with gxdev build. Keep your project's package.json build script connected to that command so hosted CI can run the same package workflow:
# When package.json defines a test script:
npm test
npm run build
# Direct toolkit invocation when needed:
gxdev build
Use Node 24 with a compatible npm version for the reviewed toolchain. If using Node 22, check the full dependency engines: current Faker requires 22.13+ and npm 10+, beyond Vite 8's 22.12 floor. Follow the package engine requirements when using a different pinned toolkit version. Commit package.json and package-lock.json together.
Output structure
The toolkit keeps compiled files in dist/build/ and creates the delivery package in dist/:
dist/
├── build/
│ ├── app-manifest.json
│ ├── assets/
│ └── compiled app and optional configuration files
└── my-app.gxpapp
A .gxpapp is the packaged archive consumed by the platform. Do not replace it with a development HTML build or upload a loose dist/ directory as the current hosted release workflow.
The packager copies assets from the manifest's asset_dir, processes optional configuration/instructions/styling files, writes the cleaned manifest, and creates a ZIP archive containing root-level JavaScript/CSS, the manifest, the recursive assets/ directory and the supported optional files. Other arbitrary files in dist/build/ are not automatically included. Keep package files within the project; package validation rejects unsafe paths and symlink escapes. Avoid an asset directory that contains the build directory.
Manifest and configuration files
The standard manifest uses manifest_version: 3. Important source-file references include:
| Manifest key | Source example | Packaged result |
|---|---|---|
asset_dir | /src/public | Assets copied into the package |
configurationFile | configuration.json | configuration.json |
appInstructionsFile | app-instructions.md | appInstructions.md |
defaultStylingFile | default-styling.css | default-styling.css |
The toolkit can also process the corresponding inline configuration, instructions and styling values. Prefer the scaffold's separate files for substantial content. Confirm every referenced file exists and is included in source control. Missing optional files produce warnings and can still yield a package; a successful build alone does not prove instructions, configuration or styling were included. File references take precedence over inline values, including when the referenced file is missing. See App Manifest and App configuration.
For example, this minimal manifest packages a public asset directory and three separate content files:
{
"name": "docs-build-example",
"version": "1.0.0",
"manifest_version": 3,
"asset_dir": "/src/public",
"configurationFile": "configuration.json",
"appInstructionsFile": "app-instructions.md",
"defaultStylingFile": "default-styling.css"
}
Create those files before building. Open the resulting .gxpapp with a ZIP viewer and check its contents: configuration.json, appInstructions.md, default-styling.css, the compiled JavaScript and your files under assets/. The filename uses the manifest name when present, replacing characters outside letters, digits, hyphens and underscores with hyphens; otherwise it falls back to the package name. Confirm the archive has the files your app actually needs before uploading it.
Customize the toolchain
The runtime supplies development/build defaults. Use the scaffold's vite.extend.js extension point for supported customization, keeping the platform's runtime imports and package output contract intact. A generic Vite application build is not a replacement for the GxP packager.
The loader checks vite.extend.js before vite.extend.mjs and uses the first existing file. It accepts an object or an async/synchronous function receiving {mode, command, env, runtimeConfig}. The result is merged with Vite's mergeConfig: plugin arrays concatenate, objects merge and scalar values can replace managed defaults. Review overrides that alter entry/output, runtime aliases or external dependencies.
A load error logs a warning and returns to the managed configuration; it does not automatically fail the build or try the second filename. An existing first file returning a non-object also stops the search. Check the “Loaded”/warning output and emitted artifact, especially if both filenames exist. A successful package is not proof that your customization ran.
Plugin code should use runtime aliases such as:
import { useGxpStore } from '@/stores/gxpPortalConfigStore'
This public store alias resolves to the host-provided store in a managed platform build. The toolkit's @gx-runtime implementation is for runtime development and should not be bundled into an app. Use the store's API helpers with operation IDs and declared dependency identifiers. Keep strings and assets configurable through the runtime rather than hardcoding development-only URLs. Review GxP Store, Strings and AppUI as needed.
Hosted CI contract
The isolated platform build uses a managed Node image (Node 24 Alpine by default), installs through npm, runs the package's test script when present, then runs its build script. It expects exactly one valid .gxpapp file at the top level of dist/, no larger than 20,000,000 bytes. The Developer Hub build panel does not expose per-app runtime/command/output overrides for this managed path. Legacy stored/API fields do not change the isolated runner's fixed commands or operator-selected image.
The runner uses npm ci when a committed package-lock.json exists and npm install otherwise. It runs npm test only when package.json defines that script, followed by npm run build. Tests and dependency installation each have a five-minute command timeout; the build command has ten minutes. Keep test scripts finite and noninteractive. A test command failure prevents packaging.
Test verification interprets exit status and recognizable output text: a zero exit with an unfamiliar report can remain unverified; an explicit no-test report becomes no_tests; an absent script is not_configured. None of those proves that meaningful tests ran. Even passed does not establish coverage of the installed workflow, and publication currently has no passed-tests gate.
The submitted source is a compressed Git archive of committed HEAD, base64 encoded and limited to 700,000 characters before the isolated build. Uncommitted files and an ignored local dependency directory are not substitutes for committed source and a usable dependency manifest. A repository can pass local packaging yet fail this separate source-payload limit. Keep generated artifacts and unrelated large files out of source; diagnose the rejected stage rather than reducing the app's required functionality.
The artifact check counts top-level filenames matching the allowed .gxpapp pattern and requires exactly one matching regular, non-symlink file within 20,000,000 bytes. A runner artifact acknowledgment is still separate from the platform's package ingestion/manifest validation and installed-app acceptance.
A build can succeed while test verification is not configured, empty or unverified. Inspect the separate verification outcome and logs. See Git Repositories and Builds for triggers and draft ingestion.
Before release
Verify meaningful tests, responsive layout, keyboard behavior, loading/errors and empty data. Confirm package assets, strings, configuration selectors and dependency identifiers. Keep server API tokens and other secrets out of browser code and client build-time variables.
Commit and review source, build the intended variant production branch, then publish its verified snapshot. Set the project installation to that published release and test real bindings and attendee rules. Your package's semantic version and the platform's numbered published-version record are different identifiers; record the Git commit and installed release as well.
The current variant-publish handler requires a completed production-branch bundle and a successful build artifact for the same repository/production branch with a valid commit SHA. It creates the release from that built commit and checks the release branch resolves to it. This is build provenance, not a guarantee that the remote branch's newest push or meaningful passing tests were released. Confirm the exact build/commit selected before publishing.
Build ingestion and publication share an app-level lock; a busy operation can return 409. Recheck the existing build/release state when it finishes before retrying publication. Publishing does not reconfigure every installation or validate its data bindings and audience rules.
Build troubleshooting
For installation failures, reconcile dependencies with the npm lockfile. For import failures, inspect aliases and the installed toolkit/runtime. For missing assets, inspect asset_dir, source files and packaged paths. For missing/duplicate output, ensure the build script invokes packaging and leaves one top-level .gxpapp.
For publication failures, check repository, production branch, successful build and verified commit. Publishing is handled in the hub; a manually copied loose JavaScript file does not establish the release provenance. Use Development Troubleshooting for session, permission and installation problems.