Multi-platform builds
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.
How it works
Run a production build:
Default browser target is chromium unless overridden.
Browser selection
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.
Output layout
Each target writes to its own folder:
dist/chromedist/edgedist/firefoxdist/chromiumdist/chromium-baseddist/gecko-based
Build capabilities
Generating a zip file
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.zip
Customize filename:
This creates my-release.zip inside the target dist/<browser> folder.
Include source archive
Use --zip-source to generate a source archive alongside distribution output.
--zip-source produces:
dist/<name>-<version>-source.zip
Polyfill support
If your code relies on Gecko-style browser.* APIs and you need Chromium compatibility, enable --polyfill:
Best practices
- Build per target in CI: Treat each browser output as an independent artifact.
- Use a browser matrix command for parity checks: Catch target-specific issues early in one pipeline step.
- Package intentionally: Use
--zipfor store uploads and--zip-sourcefor traceable source artifacts. - Keep target config explicit: Use
extension.config.*command/browser defaults for reproducible builds.
Next steps
- Learn more about the Browsers Available.
- Explore Path Resolution for asset/output mapping details.
