Skip to main content

Archibald CLI Configuration (archibald.json)

The archibald.json file is the central configuration for the Archibald build system and CLI. It defines how your project is structured, how the build behaves, and provides settings for development, optimization, and native platforms.

info

For how these settings influence the Rspack build internally, see the Archibald Configuration Deep Dive in the Architecture section.


Top-Level Properties

PropertyTypeDescription
$schemastringPath to the JSON schema for validation and autocompletion in editors.
extendConfigstringPath to an optional Rspack configuration extension file (e.g., ./rspack.extend.config.ts).
internalobjectGeneral Archibald internal settings.
projectobjectConfiguration related to the project structure and source files.
cliobjectDetailed configuration for build, serve, and optimization behaviors.

internal

General settings for the Archibald environment.

PropertyTypeDescription
packageManagerstringThe package manager used in the project (pnpm, npm, or yarn).
pathstringThe path to the Archibald development project (primarily for framework contributors).

project

Defines the structure, targets, and transformations for your application.

PropertyTypeDescription
environmentsstring[]List of target environments (e.g., local, stage, prod).
tenantsstring[]List of tenants (brands/clients) supported by the project.
platformsstring[]List of platforms (e.g., shop, app, portal).
renderingstringDefault rendering mode: ssr (Server-Side) or csr (Client-Side).
templatestringPath to the HTML template used for generation.
shadowingobjectConfiguration for file shadowing and path rewriting.
themingobjectDeprecated predecessor of shadowing.
copystring[] | object[]Assets or directories to be copied to the output folder after build.
sourceobjectPaths and file names for source code (client, server, modules).
outputobjectPaths and file names for build artifacts.
dockerobjectConfiguration for building and pushing Docker images.
vercelobjectSettings for deploying to Vercel (e.g., runtime version).

shadowing

Configuration for Archibald's powerful file shadowing mechanism.

PropertyTypeDescription
activebooleanEnables or disables the shadowing system.
useRustShadowingbooleanUse the Rust SWC plugin for shadowing instead of the Babel loader. Also accepted as useRustTheming (deprecated).
overrideMarkingobjectRequire shadowing files to be explicitly marked (see below).
optionsobjectLow-level knobs for the shadowing resolver (see below).
config(string | object)[]The shadowing rules. Each rule is one path template — "src/{platform}/client(/tenant/{tenant})" — or an object with a path template plus a sibling list per placeholder, expanding one rule into several. The fixed part may use * (one directory segment) or ** (any number), and where rules overlap the most specific one wins. See the Shadowing feature guide.

theming (deprecated)

Deprecated as of 9.1

Use shadowing instead. project.theming still works and resolves identically, and will keep working until a future major removes it. Declaring it logs a one-time warning at config load.

The predecessor of shadowing, with the same properties except that config holds { test, replace } pairs rather than path templates — run pnpx @archibald/codemod . shadowing-config to move the block across.

PropertyTypeDescription
configobject[]List of rewrite rules. Each rule has a test pattern (e.g., src/{platform}/client) and a replace path (e.g., src/{platform}/client/tenant/{tenant}).

options

Tuning for the resolver itself. Rarely needed — the defaults cover the standard project layout.

PropertyTypeDefaultDescription
validExtsstring[]see VALID_LOADER_EXTENSIONSFile extensions shadowing is resolved for.
lookupExtsstring[]['ts', 'tsx', 'js', 'jsx']Extensions probed when an import has no extension.
ignorePatternstring(css-loader|postcss-loader)Requests matching this pattern are left untouched.
cwdstringprocess.cwd()Directory the resolver runs in.
scriptBasestringproject.source.paths.srcSource root, appended to cwd to form the resolver root.

The active tenant and platform (and their inheritance chains) are derived from the build parameters and cannot be set here — they are shared by the Babel loader, the Rust backend, the override-marker check and the build cache key.

overrideMarking

Opt-in enforcement that every override file carries an @override marker naming the file it shadows. See the Shadowing feature guide for the full workflow, including @original/ imports.

PropertyTypeDefaultDescription
mode'off' | 'warn' | 'error'offoff disables the check, warn logs violations, error fails the build.
markerstring@overrideThe pragma token that marks a file as an override.
requirePathbooleantrueWhen true, the marker must also name the overridden file (path relative to the source root).

cli

Detailed settings for the build process, development server, and optimizations.

development

Settings for the local development experience.

PropertyTypeDescription
openboolean | objectWhether to open the browser automatically after build. Can specify browser (chrome, firefox, etc.) and url.
detectCircularDepsobjectConfiguration for detecting circular dependencies (off, warning, error).
typeCheckTestsbooleanEnables type checking for test files during development.
automaticRuntimebooleanUses the new React automatic JSX runtime.
debugHydrationbooleanEnables debugging tools for React hydration issues.
forkbooleanRuns build processes in parallel forks for improved speed.
flatEslintConfigbooleanInforms the CLI that the project uses the new ESLint flat configuration format.
sourcemapsboolean | stringWhen to generate sourcemaps (true, false, development, or production).

optimization

Controls the production build quality and performance.

PropertyTypeDescription
minifyboolean | stringEnables minification. Can be set to true, false, rspack, or terser.
compilerboolean | objectEnables the experimental React Compiler for automatic memoization.
svgComponentsbooleanTransforms imported SVGs directly into React components.
compressionstringCompression type for assets: none, all, brotli, or gzip.
preactbooleanSwaps React for Preact in production builds to reduce bundle size.
coreJSbooleanAutomatically includes core-js polyfills based on browser support targets.
splitChunksobjectCustom overrides for the Rspack/Webpack splitChunks configuration.
deduplicateCriticalCSSbooleanOptimizes and deduplicates CSS found in the critical rendering path.
preloadbooleanEmits a <link rel="modulepreload"> hint in the document <head> for the main module (modules) entry chunk. Off by default. Per-component chunk preloading is opt-in instead via the preloaded flag on each Loadable — see Asset Orchestration › Per-component preload.

native

Configuration for mobile development using Expo or Capacitor.

PropertyTypeDescription
frameworkstringThe mobile framework to use: expo or capacitor.
useMiddlewarebooleanEnables custom development middleware for native platforms.
expo.routerbooleanEnables Expo Router for file-based routing.
capacitor.bundlebooleanWhether to bundle the application for Capacitor.

serviceWorker

PropertyTypeDescription
activebooleanEnables Service Worker generation via Workbox.
optionsobjectWorkbox options, including swSrc (source file) and swDest (output destination).

Example archibald.json

{
"internal": {
"packageManager": "pnpm"
},
"project": {
"environments": ["local", "stage", "prod"],
"tenants": ["default"],
"platforms": ["shop"],
"rendering": "ssr"
},
"cli": {
"development": {
"open": true,
"fork": true
},
"optimization": {
"minify": "rspack",
"compiler": true,
"svgComponents": true
}
}
}