Build and package the same extension for multiple browsers with predictable outputs.
Ship the same extension to Chrome, Edge, and Firefox without maintaining separate build scripts. Extension.js can run production builds per target, write artifacts to dist/<browser>, and optionally generate zip packages for distribution.
Run a production build:
Default browser target is chromium unless overridden.
You can target a specific browser/engine:
Supported values include:
chromeedgefirefoxchromiumchromium-basedgecko-based / firefox-based (aliases)You can also run a build matrix in one command:
This builds sequentially for chrome, edge, and firefox.
Each target writes to its own folder:
dist/chromedist/edgedist/firefoxdist/chromiumdist/chromium-baseddist/gecko-based| Option | What it does |
|---|---|
--browser=<target> |
Builds for a specific browser or engine family. |
--zip |
Creates a distribution zip per target output. |
--zip-filename=<name> |
Overrides the default zip file name. |
--zip-source |
Creates a source archive alongside output. |
--polyfill |
Enables compatibility behavior for browser.* API usage in Chromium-family targets. |
Generate a distribution zip from each target output with --zip:
By default, the zip name uses sanitized manifest name + version, for example:
my-extension-1.0.0.zipCustomize filename:
This creates my-release.zip inside the target dist/<browser> folder.
Use --zip-source to generate a source archive alongside distribution output.
--zip-source produces:
dist/<name>-<version>-source.zipIf your code relies on Gecko-style browser.* APIs and you need Chromium compatibility, enable --polyfill:
--zip for store uploads and --zip-source for traceable source artifacts.extension.config.* command/browser defaults for reproducible builds.