Build flavours¶
One codebase produces three builds, selected by the GUIDEPOST_BUILD environment variable. The logic is hostPermissionsFor in apps/extension/build-flavour.ts (decision 76).
| Flavour | GUIDEPOST_BUILD |
host_permissions |
Use |
|---|---|---|---|
| Store | unset or store |
none | Store listing. Sites are granted at run time through the optional https://*/* permission |
| Managed | managed |
The comma-separated list in GUIDEPOST_APPROVED_ORIGINS |
Force-installed by policy to a fixed set of sites |
| Dev | dev |
http://localhost/* |
End-to-end tests against fixture apps. The player's shadow root is open |
WXT copies a content script's matches into host_permissions even when the script is registered at run time, so a build hook overwrites the generated manifest with exactly the list above. A store build has no host_permissions key at all.
Commands¶
| Command | Result |
|---|---|
pnpm build |
Builds the packages and the extension, then checks the content script budget (15 kB gzip) |
pnpm --filter extension build:dev |
Dev flavour. The script sets GUIDEPOST_BUILD=dev |
GUIDEPOST_BUILD=managed GUIDEPOST_APPROVED_ORIGINS=https://a.example,https://b.example pnpm --filter extension build |
Managed flavour |
pnpm build:edge |
Edge target |
pnpm zip |
Zips the extension with WXT |
pnpm schema:export |
Rewrites the JSON Schema files |
Output¶
| Build | Directory |
|---|---|
| Chrome (all three flavours) | apps/extension/.output/chrome-mv3 |
| Edge | apps/extension/.output/edge-mv3 |
All three Chrome flavours write to the same directory. Building one overwrites another.
Fixed manifest values¶
- Permissions:
storage,unlimitedStorage,sidePanel,identity,scripting,alarms. - Optional host permission:
https://*/*. - CSP for extension pages:
script-src 'self'; object-src 'self'. - A fixed public
key, which pins the extension id in unpacked and self-hosted installs. - The name and description come from
_locales.
Gotchas¶
- The managed flavour with an empty
GUIDEPOST_APPROVED_ORIGINShas no host permissions, the same as the store build. - Edge builds, and the manifest has been inspected, but the end-to-end suite has not run on Edge.
- The content script size is checked only by
pnpm build, not by a plainwxt build.