CrxOptions interface defines configuration options for customizing the behavior of the CRXJS Vite Plugin.
Import
Options
Target browser for the extension. Can be
"chrome" or "firefox". Default is "chrome".This affects how the manifest is processed and which browser-specific features are enabled.Configuration options for content script behavior during development.
Options passed to fast-glob when resolving file patterns in the manifest.Useful for customizing how files are matched (e.g., ignore patterns, follow symlinks, etc.).
ContentScriptsOptions
Custom code to inject at the beginning of every content script during development.Set to
false to disable the default preamble code that CRXJS injects for HMR support.Timeout in milliseconds for HMR (Hot Module Replacement) connections in content scripts.Default is
3000 (3 seconds). Increase this if you experience HMR connection timeouts.Whether to automatically inject CSS imports into content scripts.When
true, CSS imported in content scripts will be injected into the page. When false, CSS must be manually injected.Default behavior is determined by the plugin.Examples
Basic Configuration
Firefox Extension
Custom Content Script Configuration
Custom File Globbing
Disable Content Script Preamble
Type Definitions
Notes
The
browser option only affects plugin behavior. You still need to ensure your manifest and code are compatible with the target browser.