Update extensions/CONTRIBUTING.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Matt Bierner
2026-03-03 11:56:09 -08:00
committed by GitHub
parent ea0ea233c3
commit a7ca6e7842

View File

@@ -24,9 +24,9 @@ By default extensions will only target desktop. To enable an extension in browse
- Add a `"browser"` entry in `package.json` pointing to the browser bundle (for example `"./dist/browser/extension"`).
- Add `tsconfig.browser.json` that typechecks only browser-safe sources.
- Add a `esbuild.browser.mts` file. This should set `platform: 'browser'`.
- Add an `esbuild.browser.mts` file. This should set `platform: 'browser'`.
Make sure the browser build of the extension only uses browser safe APIs. If an extension needs different behavior between desktop and web, you can create distinct entrypoints for each target:
Make sure the browser build of the extension only uses browser-safe APIs. If an extension needs different behavior between desktop and web, you can create distinct entrypoints for each target:
- `src/extension.ts`: Desktop entrypoint.
- `src/extension.browser.ts`: Browser entrypoint. Make sure `esbuild.browser.mts` builds this and that `tsconfig.browser.json` targets it.