Manifest
CRXJS parses the manifest file to discover the entry files used by your extension.
Compared to manifest.json
, we strongly recommend using defineManifest
as it provides stronger type support and dynamic features.
Manifest Configuration
CRXJS exports a helper function called defineManifest
.
It's similar to Vite's defineConfig
and supports autocompletion and dynamic or asynchronous definitions.
Basic Usage
manifest.config.ts
Path Resolution Rules
1. Base Definition
All manifest resource configuration paths are resolved relative to the Vite project root directory (i.e., the directory where vite.config.ts
is located).
2. Correct Configuration Example
manifest.json
Features:
- Uses simple relative paths (no
./
prefix required) - Supports multi-level directory nesting
3. Common Error Patterns
manifest.json
Prohibited behaviors:
- Using path modifiers like
./
or../
- Hardcoding operating system-level absolute paths