Skip to content

Commit 32afb8d

Browse files
authored
docs: Improve manifest docs, mention entrypoint-specific options
1 parent 72b8a29 commit 32afb8d

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

docs/guide/essentials/config/manifest.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# Manifest
22

3-
In WXT, there is no `manifest.json` file in your source code. Instead, WXT generates it during the build process based off files in your project.
3+
In WXT, there is no `manifest.json` file in your source code. Instead, WXT generates the manifest from using multiple sources:
44

5-
## Manifest Config
5+
- Global options [defined in your `wxt.config.ts` file](#global-options)
6+
- Entrypoint-specific options [defined in your entrypoints](/guide/essentials/entrypoints#defining-manifest-options)
7+
- [WXT Modules](/guide/essentials/wxt-modules) added to your project can modify your manifest
8+
- [Hooks](/guide/essentials/config/hooks) defined in your project can modify your manifest
69

7-
To manually add a property to the `manifest.json` output during builds, use the `manifest` config inside `wxt.config.ts`:
10+
Your extension's `manifest.json` will be output to `.output/{target}/manifest.json` when running `wxt build`.
11+
12+
## Global Options
13+
14+
To add a property to your manifest, use the `manifest` config inside your `wxt.config.ts`:
815

916
```ts
1017
export default defineConfig({
@@ -130,7 +137,7 @@ public/
130137
└─ icon-128.png
131138
```
132139

133-
Specifically, if an icon must match one of these regex to be discovered:
140+
Specifically, an icon must match one of these regex to be discovered:
134141

135142
<<< @/../packages/wxt/src/core/utils/manifest.ts#snippet
136143

@@ -216,22 +223,7 @@ By default, whenever an `action` is generated, WXT falls back to `browser_action
216223

217224
### Action With Popup
218225

219-
To generate a manifest where a UI appears after clicking the icon, just create a [Popup entrypoint](/guide/essentials/entrypoints#popup).
220-
221-
```ts
222-
export default defineConfig({
223-
hooks: {
224-
build: {
225-
manifestGenerated(manifest) {
226-
// Update the manifest variable by reference
227-
manifest.name = 'Overriden name';
228-
},
229-
},
230-
},
231-
});
232-
```
233-
234-
If you want to use a `page_action` for MV2, add the following meta tag to the HTML document's head:
226+
To generate a manifest where a UI appears after clicking the icon, just create a [Popup entrypoint](/guide/essentials/entrypoints#popup). If you want to use a `page_action` for MV2, add the following meta tag to the HTML document's head:
235227

236228
```html
237229
<meta name="manifest.type" content="page_action" />

0 commit comments

Comments
 (0)