keepBrowserProfile

keepBrowserProfile controls whether Chromium-based browsers reuse a dev user data directory between addfox dev runs. It affects only dev mode and only Chromium-family browsers.

Type and default

  • Type: boolean | undefined
  • Default: false
  • CLI precedence:
    • --keep-browser-profile forces profile keeping on for current run
    • --no-keep-browser-profile forces profile keeping off for current run
    • If both are provided, the last flag wins

Role

  • When true (or CLI --keep-browser-profile is used):
    • Dev mode keeps a Chromium user data dir under .addfox/cache/browser-profile/<name>-user-data, so:
      • extension install state
      • extension settings
      • login sessions and cookies are kept between addfox dev runs.
  • When false:
    • Each addfox dev run uses a fresh profile for Chromium-based browsers.
  • Does not affect Firefox; Firefox profile handling is delegated to web-ext.

Priority

keepBrowserProfile is resolved in this order (highest first):

  1. CLI --keep-browser-profile / --no-keep-browser-profile
  2. browser.<name>.keepBrowserProfile (per-browser override)
  3. Top-level keepBrowserProfile
  4. Deprecated cache (CLI -c/--cache, --no-cache or config cache)
  5. Default false

Examples

Enable via config

export default defineConfig({
  keepBrowserProfile: true,
});

Per-browser override

export default defineConfig({
  browser: {
    chrome: { keepBrowserProfile: true },
  },
});

One-off via CLI

pnpm
npm
yarn
bun
pnpm dev -- --keep-browser-profile

One-off disable via CLI

pnpm
npm
yarn
bun
pnpm dev -- --no-keep-browser-profile

CLI flags override keepBrowserProfile in config for that run.

Warning

The cache config field and the -c/--cache, --no-cache CLI flags are deprecated aliases; they still work but print a deprecation warning in the terminal. Migrate to keepBrowserProfile and --keep-browser-profile / --no-keep-browser-profile.

buildCache

buildCache controls the Rspack persistent build cache, which speeds up repeated builds.

Type and default

  • Type: boolean | { cacheDirectory?: string }
  • Default: true
  • Cache files are stored in <outputRoot>/cache/build/

Examples

export default defineConfig({
  // Disable the build cache
  buildCache: false,
});
export default defineConfig({
  // Custom cache directory
  buildCache: { cacheDirectory: "./node_modules/.cache/addfox-build" },
});

For deeper rsbuild/rspack customization, use the existing rsbuild config field (object deep-merge or function form).