> ## Documentation Index
> Fetch the complete documentation index at: https://extension.js.org/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Extension.js needs Node.js 22.12 or newer; Node.js 18 and 20 do not work. It also runs on Deno 2.5+ and Bun 1.2+.
> The default browser target is chromium and a build lands in dist/<browser>, so dist/chromium by default. extension build writes a zip only when --zip is passed.
> Prefix a manifest key with a browser name when browsers differ. chromium: covers every Chromium-family target and Safari builds read it too. Since 4.1.19 chrome: means Chrome alone and edge: means Edge alone.
> Write one background.service_worker in manifest.json instead of hand-writing per-browser background keys; Extension.js converts it for each browser.
> package.json or deno.json marks the project root, not manifest.json. A config file is optional, and only extension.config.js, .mjs and .cjs are loaded, never .ts.
> The bundler is Rspack, extended through the config hook in extension.config.js. A project needs no separate bundler config file.
> Use --no-browser to skip the browser launch; --no-runner no longer exists and --no-open still launches the browser. Use --output for machine output; --format and --wait-format are deprecated.

# November 2026: smarter reloads, coded errors

> What shipped in Extension.js in November 2026: reloads only when needed, build diagnostics with stable codes, output built per browser, and packages that ship their own workers.

**November 2026**

December 3, 2026

November was eight releases, [4.1.39](https://github.com/extension-js/extension.js/releases/tag/v4.1.39) to [4.4.2](https://github.com/extension-js/extension.js/releases/tag/v4.4.2), with three minor versions in five days. Most of the work went into one place: a dev session that does less on every save and says more when something goes wrong.

## Reloads only when they are needed

Since [4.3.0](https://github.com/extension-js/extension.js/releases/tag/v4.3.0), saving a file the build never read no longer reloads the extension, and saving a page reloads only the tabs that show it. [4.2.0](https://github.com/extension-js/extension.js/releases/tag/v4.2.0) made the loop steadier under it. A save that fixes a build error rebuilds the page, a content script file deleted and written back is rebuilt, and [dev](https://extension.js.org/docs/commands/dev.md) on macOS no longer misses an edit.

[4.4.0](https://github.com/extension-js/extension.js/releases/tag/v4.4.0) made the rebuild itself faster. Two steps that ran on every rebuild went from about 155 ms to under 30 ms on a large project, and a missing file that comes back rebuilds without a second save.

## Errors a script can match on

4.2.0 gives named build warnings and errors a [stable code](https://extension.js.org/docs/contracts/error-codes.md), and `--output json` reports them without terminal layout or paths from your machine. 4.3.0 extends that to the session. A reload that did not land reports `W_RELOAD_NOT_APPLIED` in `--output json` and `events.ndjson`, and a broken `package.json` stops `build`, `dev`, `start` and `preview` with `E_PACKAGE_JSON_INVALID`.

The failures that used to hang now end. A browser that does not start within 3 minutes is reported with `E_BROWSER_START_TIMEOUT` while rebuilds keep running. And since 4.4.0 a JSON file that fails to parse is reported by line and column, never by quoting its text.

## Each browser is built for itself

4.3.0 compiles Firefox output for `firefox >= 98` and Safari output for `safari >= 15.4`, and a prefixed permission such as `"gecko:tabs"` [stays with its browser](https://extension.js.org/docs/features/browser-specific-fields.md). [4.1.40](https://github.com/extension-js/extension.js/releases/tag/v4.1.40) did the store-facing half:

* A Firefox build [splits large files](https://extension.js.org/docs/commands/build.md#firefox-builds-split-large-files) so addons.mozilla.org can parse every script, and names any file it cannot split.
* [`icon_variants`](https://extension.js.org/docs/implementation-guide/icons#icon-variants) builds for every browser. A browser that does not read the key yet, Safari included, gets `icons` filled from your variants.
* The `browser` polyfill is [off by default on Chromium](https://extension.js.org/docs/features/multi-platform-builds.md#polyfilling-browser-apis), since Chromium 148 and later ship `browser` natively. Pass `--polyfill` to keep it for older versions.

4.1.39 added the `exclude` key, which [leaves a page or script out of one browser's build](https://extension.js.org/docs/features/special-folders.md#leaving-a-file-out-of-one-browser), and an Edge store zip that leaves the manifest `key` out while `dist/edge` keeps it for your OAuth redirects.

## MAIN world scripts and content script styles

A file your background registers or injects into the [MAIN world](https://extension.js.org/docs/implementation-guide/content-scripts.md#main-world-notes) at runtime now works in dev. Since 4.1.40 it loads its chunks and resolves extension URLs on Chrome and Firefox. With `polyfill: true`, 4.2.0 keeps `webextension-polyfill` out of MAIN world content scripts and sandboxed pages, where it threw.

Content script styles got the same attention. Component styles, CSS modules and a Vue `<style>` block now reach the page, and a stylesheet edit lands in the open tab without a reload.

## A browser that starts clean and quits at once

[4.4.1](https://github.com/extension-js/extension.js/releases/tag/v4.4.1) is about the window itself. A Chrome session on a kept profile no longer ends with the extension turned off. Edge shows no "Installed theme, Undo" bar, and neither Edge nor Chromium shows the "unsupported command-line flag" bar. Ctrl+C in `preview` and `start` quits as the browser process ends, in well under a second where it took five.

4.4.0 covers the launch. A [pinned browser binary](https://extension.js.org/docs/browsers/running-other-browsers.md) is never ignored, so `--gecko-binary` alone runs a Gecko browser, and a failed launch names the binary and what pinned it. On Windows, Ctrl+C closes the browser at once, and a Firefox session follows the browser through a self-update.

## Packages that bring their own workers

[4.4.2](https://github.com/extension-js/extension.js/releases/tag/v4.4.2) is for extensions that ship heavy packages such as `@ffmpeg/ffmpeg` or a SQLite build. `import(url)` and `new Worker(new URL(url, import.meta.url))` with a URL only known at run time stay as written, where they compiled into a call that always threw. A module imported with `?url` ships with the files it imports beside it, and a `?url` import of a package with an `exports` map resolves.

A service worker that imports from a folder by name, as in ``import(`./locales/${name}.js`)``, builds again with those files inside the worker.

## Your config is followed

Since 4.3.0 a Babel config runs before SWC, tsconfig `jsxImportSource` and `useDefineForClassFields` apply, and `extension.config.js` sees the mode and browser of the command. [4.1.41](https://github.com/extension-js/extension.js/releases/tag/v4.1.41) loosened the [default types](https://extension.js.org/docs/languages-and-frameworks/typescript.md#extension-api-types) to accept the calls the browser accepts, such as `chrome.tabs.sendMessage(tabId, message, callback)`, without `@types/chrome`.

## Also

Private files such as `.env`, `.npmrc` and `.git` are never copied into a build since 4.2.0, even from `public/`, and a production build warns when a public env variable is [named like a secret](https://extension.js.org/docs/features/environment-variables.md#secrets-never-take-the-extension_public_-prefix). Telemetry honors [`DO_NOT_TRACK`](https://extension.js.org/docs/features/telemetry-and-privacy#opt-out) from 4.2.0, and `extension telemetry reset` removes the stored ID. Safari builds take [your own app icon](https://extension.js.org/docs/browsers/safari.md#app-identity-and-packaging-options), and `npx extension@latest create my-extension --template=devtools-typescript-sqlite` starts a DevTools panel backed by SQLite.

December opens with 4.4.3 on the way. A `.svelte` or `.vue` file in a project without the framework installed says what to install, and a production build stops instead of shipping uncompiled Sass. More on that next time.

Cezar Augusto\\

Creator and Lead Developer, Extension.js


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.