Warning: This feature is a work in progress and may be incomplete or subject to change. If you see an error or something that could be improved, please make a pull-request. The link that documents this feature can be found at the bottom of the page.
Building a production-ready extension with Extension.js is straightforward, allowing you to bundle your code, optimize assets, and generate ready-to-deploy zip files for all supported browsers. This guide covers the key features and capabilities that help you create optimized builds that are ready for the Chrome, Edge, and Firefox stores.
Each browser has its own set of requirements and configurations for extensions. To create a production-ready build of your extension, run the following command:
This will create a production build in the dist/
folder for the default browser (Chrome).
The output includes optimized JavaScript, CSS, and other assets.
You can also target specific browsers using the --browser
flag:
The resulting build will be placed in dist/firefox
, including any necessary browser-specific configurations.
To automatically generate a zip file for distribution, use the --zip
flag. The zip file will include
all necessary assets and manifest files for the specified browser:
The zip file will be named according to the extension's name
and version
in manifest.json
(e.g., my-extension-1.0.0.zip
for Chrome).
Ensure compatibility with older browsers by adding the --polyfill
flag.
This includes necessary polyfills during the build process to ensure your extension runs on older versions of the browser: