File-based Entry
Do not configure entry, let the framework discover entries automatically by directory and file name under appDir (default is app/).
Directory Convention
Create directories under app/ using entry names:
app
background
index.ts# → background entry
content
index.ts# → content entry
popup
index.ts# → popup entry
options
index.ts# → options entry
sidepanel
index.ts# → sidepanel entry
devtools
index.ts# → devtools entry
...
Discovery Rules
The framework automatically recognizes the following reserved entry names:
HTML Handling
Entries without HTML
background and content only need script files. The framework builds them as pure JS entries.
Entries with HTML
popup, options, sidepanel, devtools, offscreen need HTML templates:
- Auto-generate HTML: If no HTML file is provided, Rsbuild auto-generates one with
<div id="app"></div> - Custom HTML template: Create
index.htmlin the same directory, mark entry script withdata-addfox-entry
Example: Custom HTML Template
Advantages
- Zero configuration: Follow conventions, no config needed
- Clear structure: One directory per entry, easy to navigate
- Easy to extend: Add new entries by creating directories
- Framework-agnostic: Works with React, Vue, Svelte, or vanilla JS
When to Use
File-based entry is recommended when:
- You follow standard extension architecture
- You want minimal configuration
- Your project structure aligns with entry organization
Hybrid with Config-based
File-based discovery works alongside config-based entry. If you need to override specific entries while keeping auto-discovery for others:
Priority: config.entry > manifest source paths > auto-discovery
Next Steps
- Entry Concepts — Learn about entry types and principles
- Config-based Entry — Learn explicit entry configuration
- manifest configuration — Configure extension manifest

