Files
wxt/docs/config.md
T

4.4 KiB
Generated

Config Reference

Discover all the options you can use in your wxt.config.ts file.

root

  • Type: string
  • Default: process.cwd()

Your project's root directory containing the package.json used to fill out the manifest.json.

srcDir

  • Type: string
  • Default: config.root

Directory containing all source code. Set to "src" to move all source code to a src/ directory.

publicDir

  • Type: string
  • Default: "${config.root}/public"

Directory containing files that will be copied to the output directory as-is.

entrypointsDir

  • Type: string
  • Default: "${config.srcDir}/entrypoints"

configFile

  • Type: string | false
  • Default: "wxt.config.ts"

Path to "wxt.config.ts" file or false to disable config file discovery.

storeIds.chrome

  • Type: string
  • Default: undefined

storeIds.firefox

  • Type: string
  • Default: undefined

storeIds.edge

  • Type: string
  • Default: undefined

mode

  • Type: string
  • Default: undefined

Explicitly set a mode to run in. This will override the default mode for each command, and can be overridden by the command line --mode option.

browser

  • Type: "chrome" | "firefox" | "safari" | "edge" | "opera"
  • Default: "chrome"

Explicitly set a browser to build for. This will override the default browser for each command, and can be overridden by the command line --browser option.

manifestVersion

  • Type: 2 | 3
  • Default: undefined

Explicitly set a manifest version to target. This will override the default manifest version for each command, and can be overridden by the command line --mv2 or --mv3 option.

manifest

  • Type: Manifest | Promise<Manifest> | () => Manifest | () => Promise<Manifest>
  • Default: undefined

Customize the manifest.json output. Can be an object, promise, or function that returns an object or promise.

runner.openConsole

  • Type: boolean
  • Default: undefined

runner.openDevtools

  • Type: boolean
  • Default: undefined

runner.binaries.chrome

  • Type: string
  • Default: undefined

runner.binaries.edge

  • Type: string
  • Default: undefined

runner.binaries.opera

  • Type: string
  • Default: undefined

runner.binaries.firefox

  • Type: string
  • Default: undefined

runner.firefoxProfile

  • Type: string
  • Default: undefined

runner.chromiumProfile

  • Type: string
  • Default: undefined

runner.firefoxArgs

  • Type: string[]
  • Default: undefined

runner.chromiumArgs

  • Type: string[]
  • Default: undefined

runner.startUrls

  • Type: string[]
  • Default: undefined

zip.artifactTemplate

  • Type: string
  • Default: "{name}-{version}-{browser}.zip"

Configure the filename output when zipping files.

Available template variables:

  • {name} - The project's name converted to kebab-case
  • {version} - The version_name or version from the manifest
  • {browser} - The target browser from the --browser CLI flag
  • {manifestVersion} - Either "2" or "3"

zip.sourcesTemplate

  • Type: string
  • Default: "{name}-{version}-sources.zip"

Configure the filename output when zipping files.

Available template variables:

  • {name} - The project's name converted to kebab-case
  • {version} - The version_name or version from the manifest
  • {browser} - The target browser from the --browser CLI flag
  • {manifestVersion} - Either "2" or "3"

zip.name

  • Type: string
  • Default: undefined

Override the artifactTemplate's {name} template variable. Defaults to the package.json's name, or if that doesn't exist, the current working directories name.

zip.sourcesRoot

  • Type: string
  • Default: config.root

Root directory to ZIP when generating the sources ZIP.

zip.ignoredSources

  • Type: string[]
  • Default: undefined

Minimatch patterns of files to exclude when creating a ZIP of all your source code for Firfox. Patterns are relative to your config.zip.sourcesRoot.

Hidden files, node_modules, and tests are ignored by default.