entry
entry defines the entry map: keys are entry names, values are JS/TS script paths or structured objects relative to baseDir. When omitted, the framework discovers background, content, popup, options, sidepanel, devtools under appDir (default app/) by directory name.
Type and baseDir
- Type:
Record<string, string | { src: string; html?: boolean | string }> | undefined - baseDir: When appDir is not set, baseDir =
app/; when set, baseDir =appDir. All entry values are relative to baseDir.
Reserved entry names
These names are fixed by the extension spec and framework:
Other names can be custom entries (e.g. capture, offscreen) as long as the directory has the corresponding script.
Path rules
- JS/TS entry only: the real entry is always JS/TS (
.js,.jsx,.ts,.tsx). HTML is template only. - HTML template rules: if you use an HTML template, do not import CSS or other resources in the HTML. The HTML is not compiled; only the JS/TS entry is compiled.
- Single main entry: HTML templates must include one
<script>tag withdata-addfox-entryand a JS/TSsrc:- Example:
<script type="module" src="./main.ts" data-addfox-entry></script>
- Example:
backgroundandcontentare script-only entries (no HTML generated).- For
popup,options,sidepanel,devtools, HTML is generated by default. If a template exists, it is used as the template.
When entry is omitted
The framework scans baseDir and discovers the reserved names by looking for scripts (e.g. background/index.ts, popup/index.ts, popup.ts). If only an HTML template exists, the framework reads data-addfox-entry to locate the JS/TS entry and auto-generates { src, html }.
Supported layouts
- Flat files under baseDir:
popup.ts,content.ts,background.js, etc. - Single-level dirs:
popup/index.ts,content/index.ts,background/index.ts.
Nested multi-level entry folders are not supported.
Examples
Default discovery (no entry config)
No entry needed in config. The framework discovers script entries; if an index.html exists alongside the script, it is used as the HTML template.
HTML template only (data-addfox-entry)
No entry needed. The framework reads data-addfox-entry and auto-declares { src, html }.
Custom entries and overrides
When entry is set, only the declared entries are used. You can mix reserved and custom names.

